title: How do I get a rainbow color gradient in C#?
body: <p>I'd like to have an enumeration of Colors based on the rainbow colors (red... yellow... green... blue...).</p>
  
  <p>I see basically two ways to do that:</p>
  
  <ol>
  <li><p>Create a lookup table containing some important reference colors and interpolate between these. I don't like this idea at all.</p></li>
  <li><p>Apply some more or less fancy math. Probably less, but I don't quite see how it works. Any ideas?</p></li>
  </ol>
  
  <p>(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.)</p>
  
  <p><b>Edit:</b> 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.</p>