Colour Picker
Whether you are building a website, tweaking a brand palette, styling a chart or just matching a colour you like, you constantly need to move between the different ways colours are written, and this tool does exactly that with a live preview. Pick a colour using the swatch picker, or type a value in any of the three standard formats, and it instantly shows you the matching HEX code, RGB values and HSL values, all kept in sync, with a large preview block so you can see the colour you are working with. The three formats each have their strengths. HEX, the six-digit code like the green used across this site, is the everyday currency of web design and CSS, compact and easy to paste. RGB describes the colour as amounts of red, green and blue from 0 to 255, which maps directly to how screens actually mix light and is handy when you are nudging a single channel. HSL, for hue, saturation and lightness, is often the most intuitive to adjust by hand, because you can spin the hue around the colour wheel, dial the saturation up or down to make a colour more or less vivid, and change the lightness without touching the underlying colour. Being able to convert freely between them means you can grab a HEX code from a style guide, fine-tune it in HSL, and read off the RGB for a tool that needs it, all without leaving the page. It is a quick, dependable helper for designers, developers, marketers and anyone who works with colour. The conversions and a worked example are explained below.
How it works
A HEX code is three pairs of hexadecimal digits for red, green and blue, each from 00 to FF, which is 0 to 255 in decimal. Converting RGB to HEX turns each 0 to 255 value into two hex digits. HSL is found from RGB by scaling the values to 0 to 1, taking the maximum and minimum to get lightness and saturation, and computing the hue from which channel is largest.
Worked example
The colour red 40, green 167, blue 69 becomes the HEX code #28A745, since 40 is 28 in hex, 167 is A7, and 69 is 45. In HSL it is a hue of about 134 degrees, a saturation of about 61 percent and a lightness of about 41 percent, a medium green.
Related calculators
- RGB to HSL Converter: RGB and HSL.
- Hex Colour to Nearest Name: name a colour.
- Megapixel Calculator: image resolution.
- DPI and PPI Calculator: pixel density.
- World Clock NZ: Current Time in Major Cities and Time Zone Converter.