You can create one using random while the other as a complimentary color. I think what you need is in this link. Computing complementary colors: http://serennu.com/colour/rgbtohsl.php It's up to you if you are going to change the color of the ball or background. For muti color background try getting the color of the background to where the ball is centrally positioned.