title: Iterating over colors
body: <p>Is there a good way to iterate over colors?  I know it sounds like a strange question but here's an analogy.</p>
  
  <p>Suppose you write a game where you travel around the Earth.  You pick a starting point and then you define a rule that you apply repeatedly.  For example:  Start at your current location on Earth and then define the great circle that goes through your location and the North and South poles.  For every step, travel 10 miles along this circle.  Each step takes you to a similar climate as the one before (although sometimes you're awfully wet because you're in the ocean).  Or travel 6,000 miles for each step.  Now each step is a very different climate.</p>
  
  <p>Now imagine a program that draws elements on the screen with random colors.  Maybe you set the increment to a low number, and each color is very similar to the one before.  Maybe you set it high, and each color is very different from the one before.</p>
  
  <p>If you use RGB values and increment the R, G and B each by a small amount you get gradual changes until one of the values wraps and you get a sudden change.</p>
  
  <p>With HSB values, the gamut of Hues is circular, so there is no discontinuity.  S and B are not, and you may run into a stretch of indistinguishable colors because S is so low that they all look white.  Keeping S and B at max is a possibility, although it leaves out a lot of colors.</p>
  
  <p>Each run of the program uses only a small number of colors (10 to 15).  I would like to pick values at random so that one time the colors blend harmoniously, one time they clash, one time they are all pastels, one time they are a mix of saturated and pastel, etc.</p>