I'd like to have an enumeration of Colors based on the rainbow colors (red... yellow... green... blue...).
I see basically two ways to do that:
Create a lookup table containing some important reference colors and interpolate between these. I don't like this idea at all.
Apply some more or less fancy math. Probably less, but I don't quite see how it works. Any ideas?
(Oh, and while I did some SO research, I found no good results. If this question was already posted, please just point me to the location and I'll delete this.)
Edit: I'd prefer to have this independent of the used technology to display the gradient. For instance, something like GetRainbowColor (float f) with f ranging from 0 (red) to 1 (violet) would work great.