Screens add light to make colour
Each point on a screen contains red, green and blue light, and colour comes from adjusting their intensities. All three at maximum is white and all three at zero is black. Unlike paint, which darkens as you mix, light brightens as you add. Screen colour is therefore expressed as the intensity of those three lights.
HEX and RGB say the same thing
RGB writes the three intensities as numbers from 0 to 255. HEX writes those same three numbers as two hexadecimal digits each, joined together, because two hex digits hold exactly 0 to 255. The two carry identical information and differ only in notation.
- #FF0000 = rgb(255, 0, 0) = red
- #000000 = rgb(0, 0, 0) = black
- #FFFFFF = rgb(255, 255, 255) = white
- The three-digit form #F00 equals #FF0000
Why HSL is convenient
Making a colour slightly lighter from HEX or RGB means working out how much to raise each of three numbers. HSL separates hue, saturation and lightness, so only the lightness value changes. It is especially convenient for building a palette that varies lightness within one hue. It points at the same colours, but it is more intuitive to adjust.
When transparency is added
A fourth value sometimes follows the colour, and that is transparency. HEX gains two more digits for eight in total, and RGB writes it as a fourth value. A transparent colour's final appearance depends on what sits behind it, so contrast must be checked over the actual background.
Screens differ from print
Print layers ink to subtract light, the opposite principle from a screen. Some colours that look vivid on screen therefore cannot be reproduced in print. Colours chosen for a screen and used directly in printed material are why the result can look muddy.
🌍 Search the web for this
Each button runs this keyword on that search engine