posted 16 years ago
The other thing I just noticed, is you need to modify your random color generation. Right now, it will always give you black, or a color with an RGB value of 0,0,0. The reason is this... Math.random() returns a double between 0 and 1. The int casting is happening before that value is getting multiplied by the 255. And based on the way int casting works, it will always cast to zero since it simply truncates. So you are always multiplying 0 and 255.
To fix, simply put the multiplication in parentheses so it happens before the casting:
Do that for all three colors.
[ July 27, 2008: Message edited by: Mark Vedder ]