Шаблон:Weather box/colt/sandbox

Матеріал з Вікіпедії — вільної енциклопедії.
Перейти до навігації Перейти до пошуку

background:white; color:#000; font-size:85%

The Template:Weather_box/colt makes temperature ("t") background colors. It is an alternative to Template:Weather box/colpastel, which uses lighter shades of color.

Шаблон:Weather box/temperature

Performance considerations[ред. код]

Template:Weather_box/colt has been optimized to handle a range of values which are changed into color codes by using a #switch function, with 47 branches, ordered by expected frequency. It can assign colors to temperatures in Celsius at over 460 numbers per second, or 9x faster than encoding color settings as 3-part hexadecimal conversions of temperatures. The 47 branches split the overall range into 3-unit brackets, rather than using a precise spectrum of hundreds of shades of color; however, in practice, the 47 possible shades provide enough contrast to emphasize low versus high temperatures.

See also[ред. код]