How the colour codes relate
Choose a colour with your browser’s own colour picker and the tool shows it three ways. HEX is the web shorthand: three pairs of hexadecimal digits for red, green and blue. RGB writes the same three amounts as numbers from 0 to 255. HSL describes the colour as a hue angle on the colour wheel (0 to 360), a saturation percentage and a lightness percentage, which is the easiest form when you want a lighter or duller shade of the same colour.
Worked example
The saffron usually used for the Indian flag on screens, #FF9933, is rgb(255, 153, 51): FF is 255, 99 is 153 and 33 is 51. In HSL it is hsl(30, 100%, 60%), an orange hue at full saturation. The flag green #138808 is hsl(115, 89%, 28%), and the navy blue of the Chakra, #000080, is hsl(240, 100%, 25%).
Limits and common mistakes
- HSL values are rounded to whole numbers, so turning them back into HEX can land one step away from the original.
- There is no transparency (alpha) value. Add it yourself in CSS, for example rgba(255, 153, 51, 0.5).
- Screen colours are not print colours. Printers work in CMYK, so ask for a printed proof before ordering banners or visiting cards.
- The picker window depends on your browser and device. Some desktop browsers include an eyedropper for taking a colour from the screen; others do not.
Frequently Asked Questions
How do I enter a colour I already know?
Use the browser colour control to choose the colour, then read the HEX, RGB and HSL values below it. This page displays those formats; it does not provide a separate text field for every format.
Why does HSL saturation look different from brightness?
HSL describes hue, saturation and lightness separately. Changing lightness can make the colour look washed out or darker even when the saturation number stays the same. Compare the preview as well as the numbers.
Does a colour value tell me whether text is readable?
A single colour value does not measure text contrast. You need to compare the foreground with its background. Check the pair in a contrast checker before using it for body text, buttons or instructions.