This project was somewhat hard for me. I had trouble trying to control when the ball would actually change color as it collided with the edges of the screen. However, i used if ballY is just below the edge of the canvas then it would change the color and vice versa. i couldn’t figure out how to control it well.
Here is the code.