Template:Weather box/colgreen/doc

The Template:Weather_box/colgreen makes rain (precipitation) background colors. It is an alternative to Template:Weather box/colp, which uses the standard colors.

Performance considerations
Template:Weather_box/colgreen has been optimized to handle a range of values which are changed into color codes by using a  function, with 25 branches, ordered by expected frequency. It can assign colors to rainfall in mm at over 460 numbers per second, or 9x faster than encoding color settings as 3-part hexadecimal conversions of milimetres. The 25 branches split the overall range into 12-unit brackets, rather than using a precise spectrum of hundreds of shades of color; however, in practice the 25 possible shades provide enough contrast to emphasize small versus large amounts of rainfall.