At least for this US reader, you have your traffic light upside down.

;-)

But, more seriously, you could make your life easier if you used Red-Greeen-Blue for your range. Red-Yellow-Green just doesn't work even for your range of 10 possibilities; never mind for 100 (and certainly not for 100 distinguishable, web-safe colors.

You may find some useful ideas (albeit, neither modules nor even code snippets) at this academic (UIUC) site. In addition, Wikipedia has an interesting item on color theory, including this which is particularly relevant to your question, identifying as a "problem"...

... the tendency to describe color effects holistically or categorically, for example as a contrast between "yellow" and "blue" conceived as generic colors, when most color effects are due to contrasts on three relative attributes that define all colors:

  1. lightness (light vs. dark, or white vs. black),
  2. saturation (intense vs. dull), and
  3. hue (e.g., red, orange, yellow, green, blue or purple).

Thus, the visual impact of "yellow" vs. "blue" hues in visual design depends on the relative lightness and intensity of the hues.

Update: Fixed the (badly borked) markup.


In reply to Re: CPAN Module for Normalizing to Green-Yellow-Red Color Scheme? by ww
in thread CPAN Module for Normalizing to Green-Yellow-Red Color Scheme? by shoness

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.