Harold Cohen’s Coloring Algorithm in C++

Harold Cohen’s coloring formula is a heuristic method by which to probabilistically control randomly generated color saturation, and lightness values.It has been used extensively by his AARON algorithmic painter, and is summarized in detail in the essay “Color, Simply,” 2006. I ported the algorithm into a C++ as a class which you can download here (relies on AlloCore currently. A standalone version is soon to come).
The algorithm can be described as follows:

  1. Three normalized number ranges are chosen, corresponding to low, medium, and high values. For example 0.15-0.35 (L), 0.4-0.65 (M), 0.8-1.0 (H)
  2. These are set up in a 3×3 matrix, each corresponding to a possible saturation-lightness pairing. For example, a low-low (LL) pairing would provide both saturation and lightness values chosen randomly from within the low range
  3. During initialization, a probability value is assigned to each of the 9 pairing possibilities inside of this matrix. Cohen suggests only using 2-3 of them per composition, for example: 20%-LL, 40%-HL, and 40%-MH
  4. When a new color is desired, one of these range pairs is selected based on its assigned probability, and then a specific saturation-lightness pair is chosen randomly from within each of the selected pair’s ranges.

Leave a Reply

Your email address will not be published. Required fields are marked *