HEX, RGB, HSL & CMYK Explained

Last reviewed on 24 April 2026

Designers and developers bounce between half a dozen different ways of writing the same colour. This guide covers the four most common — HEX, RGB, HSL, and CMYK — in plain language, with guidance on when each one is the right choice.

RGB

RGB describes a colour as a mix of red, green, and blue light. Screens produce colour by lighting red, green, and blue sub-pixels at different intensities, so RGB maps directly to how the display works. Each channel is typically a number between 0 and 255. Pure black is rgb(0, 0, 0); pure white is rgb(255, 255, 255); pure red is rgb(255, 0, 0).

When to use it: anything written directly for the screen — CSS (which supports rgb() and rgba() functions), design tools, and image editors. RGB is the authoritative model for on-screen colour.

HEX

HEX is a more compact notation for exactly the same information as RGB. Instead of three decimal numbers from 0 to 255, HEX uses six hexadecimal digits from 00 to FF. Each pair represents one channel: RRGGBB. So rgb(255, 0, 0) becomes #FF0000, and rgb(70, 130, 180) becomes #4682B4.

When to use it: almost anywhere a colour appears in code. HEX is the default in CSS, design handoff tools, and brand guidelines because it's short, unambiguous, and easy to copy. Modern CSS also supports eight-digit HEX (#RRGGBBAA) for colours with alpha/opacity.

HSL

HSL describes colour by hue, saturation, and lightness, which matches how people talk about colour in the real world. Hue is a degree from 0 to 360 around the colour wheel; saturation is a percentage from 0 (grey) to 100 (full colour); lightness is a percentage from 0 (black) to 100 (white).

Why it matters: HSL is the best model for editing colours in a systematic way. Want a slightly darker version of your brand red? Drop the lightness by 10%. Want a desaturated version? Drop the saturation. Compare to RGB/HEX, where the same change requires recomputing all three channels.

When to use it: design-systems code, colour-ramp generation, and anywhere you'll programmatically derive related colours from a base.

CMYK

CMYK is used for printed colour, not screen colour. Print reproduces colour by laying down ink in four channels — cyan, magenta, yellow, and key (black) — in percentages from 0 to 100. The same RGB value on a screen and a printer usually produces different colours because the two systems start from different physics (additive light versus subtractive pigment).

When to use it: packaging, print collateral, editorial print, signage, and anything that involves a printer. If a project has both screen and print deliverables, designers typically define the brand in a Pantone swatch and provide both CMYK and RGB/HEX versions.

Converting between models

Conversion between these models is well-defined mathematically, and every modern design tool does it automatically. But a few things are worth keeping in mind:

Other models you may see

Practical tips

Next steps