Formatting colour strings#
Peakhour supports the following formats for color strings:
- CSS named colors: We support over 140 standard color names based on the colors supported by the X Window system and most web browsers. Color names are case-insensitive, so red and Red both specify pure red.
- Hexadecimal color specifiers: Given as #rgb or #rrggbb, such as #ff0000 for pure red.
- RGB functions: Specified as rgb(red, green, blue) with values ranging from 0 to 255 or as percentages (0% to 100%). For example, both rgb(255, 0, 0) and rgb(100%, 0%, 0%) specify pure red.
- Hue-Saturation-Lightness (HSL) functions: Given as hsl(hue, saturation%, lightness%). The hue is given as an angle between 0 and 360 (red=0, green=120, blue=240), saturation is a value between 0% and 100% (gray=0%, full color=100%), and lightness is a value between 0% and 100% (black=0%, normal=50%, white=100%). For example, hsl(0, 100%, 50%) specifies pure red.