Suppose I have a linear integer scale with GREEN assigned to the uppermost scale value and RED to the lowest scale value. YELLOW is assigned to the median scale value. (Like a traffic light that uses HTML color codes.)
If my scale is from 0 to 2, my color choices are easy.
- 2 = BRIGHT GREEN
- 1 = BRIGHT YELLOW
- 0 = BRIGHT RED
When I have a larger scale, then it's more difficult. For instance, if my scale is from 0 to 10.
- 10 = BRIGHT GREEN
- 9 = GREEN
- 8 = DARK GREEN ?
- 7 = ???
- 6 = ???
- 5 = YELLOW
- 4 = ???
- 3 = ???
- 2 = DARK RED ?
- 1 = RED
- 0 = BRIGHT RED
It's worse when the scale goes from 0 to 100?
There must be a CPAN module to help choose these (web-safe) colors, but I can't find one via searching...
Color::Calc::WWW
Color::Library::Color
Thanks for your help!
/Go Sharks!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.