Colour formats
- HEX (#1A5BC4): red, green and blue as two hex digits each. It is the standard on the web.
- RGB (26, 91, 196): the same three values from 0 to 255.
- HSL (217°, 77%, 44%): hue, saturation and lightness. It is the easiest format for making lighter or darker versions of a colour.
- CMYK: cyan, magenta, yellow and black ink percentages used in printing. This conversion is a simple approximation; printers use colour profiles for exact results.
Contrast (WCAG)
For readable text, WCAG 2.2 asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (AA), or 7:1 for AAA.
Frequently asked questions
How do I convert HEX to RGB?
Split the six digits into three pairs and convert each from hexadecimal: #1A5BC4 gives 1A = 26, 5B = 91, C4 = 196, so rgb(26, 91, 196).