Three ways to write one color
| HEX | #2563D9 |
| RGB | rgb(37, 99, 217) |
| HSL | hsl(219, 71%, 50%) |
All three are the same blue. Screens mix every color from red, green and blue light, and each format is a different way of writing those amounts.
RGB and HEX
RGB gives red, green and blue from 0 to 255. HEX writes the same three numbers in base 16, two digits each: 25 is 37, 63 is 99 and D9 is 217. A short code like #FFF doubles each digit (#FFFFFF, white), and a fourth pair adds transparency (#2563D980 is about half see-through).
HSL
HSL describes a color the way people think of it: hue is the position on the color wheel in degrees (0 red, 120 green, 240 blue), saturation is how strong it is, and lightness runs from black at 0% to white at 100%. That makes it easy to make a lighter or darker shade: keep the hue and saturation, change the lightness.
CMYK is for print
Printers mix cyan, magenta, yellow and black ink instead of light. Conversions between RGB and CMYK are approximate, because screens and inks cannot show exactly the same range of colors.
Contrast for text
The WCAG accessibility guidelines ask for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text at level AA. The Color Converter converts between all these formats and checks contrast against white and black text. To find the code of a color in a photo or screenshot, use the Image Color Picker.