in reply to to generate a set of well contrasted colors

I'll agree with most of the previous posters; doing both the random selection and the contrast in a psychologically relevant color model, any one, would be better. Myself, I've always used HSV space, but any of several mentioned works.

The +128%256 operation will not achieve maximal contrast in some cases (it results in Grey on White or Black), but at least it avoids the inverse-video transform trap in which neutral gray transforms to itself.

-- Bill / N1VUX

  • Comment on Re: to generate a set of well contrasted colors