Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Random Colors

Name: Anonymous 2013-02-05 15:58

Hey /prog/,

I'm doing some graph plotting and am trying to get the lines joining the dots to be different colors. The obvious idea was to use a random number generator three times per color (RGB values up to 255 etc.) and then store said color for future use. However, are there any methods or ideas to ensure that the colors are always somewhat very different visibly from one another? (Demonstration code can be any language of your choice if you wish to provide any)

Name: Anonymous 2013-02-05 16:19

red = Rand() * 0xf << 4

it will round colors together

Name: Anonymous 2013-02-05 16:34

>>2

Thanks for that, much appreciated.

Don't change these.
Name: Email:
Entire Thread Thread List