How do you make a Canvas background color change, when a ball hits (Well, more like bounce) off the edge?

This is all I did, but it bugged out:


I hope anyone can help, Thanks!

Welcome to the community, the problem is how you make color. Make color block takes a list of 3 or 4 numbers. These numbers in this list represent values in an RGB code. See more here

https://www.w3schools.com/colors/colors_rgb.asp

2 Likes

Thank you!

1 Like

Hello sorry to disturb you again, but I want to ask for example, 255 is red. Red is 0,255,0. But I want another color which is yellow. I don't know how to add it because the RGB is 255, 255, 0. Thank you and sorry to disturb you one more time

You can set background to only one color but you can make a list of colors and when edge reached pick a different color or assing a different color to different edges

First case

Second case

So that is how. Thank you, again!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.