tags:

views:

51

answers:

1

I have been using the random function to generate color values xi = [a, b, c] where a, b, and c can be any number from 0 to 255.

I need ideas to write a function that generate x values as different as possible for the human eye. One of the problems I am having is that I don't know the number of x elements that will be generated. So my previous functions attempts are generating values that end up quickly converging as more and more values are generated.

Ideas?

+5  A: 

Using a different colour model can help here - for example, you could use HSV, and then cycle through the hue while maintaining a consistent saturation and value.

HSV also makes it easier to generate colours which complement each other, for example, you could take 2 colours with hues 120 or 180 degrees apart.

See also

Paul Dixon
Awesome. Thanks.
relima