Color Space Reference: RGB vs HSL vs CMYK

Three ways of describing the same color, built for three different jobs. Here's the actual math and where each one belongs.

Gamut & size comparison

SpaceModelApprox. addressable colorsBuilt for
RGBAdditive (light)~16.7 million (8-bit/channel)Screens, web, digital images
HSLCylindrical remap of RGBSame gamut as RGBHuman-friendly hue/lightness editing
CMYKSubtractive (ink)~16,000 practically reproduciblePrint production

RGB and HSL describe exactly the same set of colors — HSL is just a rotation of the RGB cube into a cylinder so hue, saturation, and lightness can be adjusted independently. CMYK is a genuinely smaller, physically different gamut: some saturated RGB colors (electric blues, neon greens) simply cannot be printed and will shift when converted, because ink pigments can't reproduce every wavelength combination a backlit screen can.

RGB → HSL

Given R, G, B normalized to 0–1, with max/min the largest/smallest channel:

L = (max + min) / 2 S = (max − min) / (1 − |2L − 1|) [0 if max = min] H depends on which channel is max, computed in 60° segments

RGB → CMYK

The naive (non-color-managed) conversion used by most web tools, including this one:

K = 1 − max(R', G', B') C = (1 − R' − K) / (1 − K) M = (1 − G' − K) / (1 − K) Y = (1 − B' − K) / (1 − K)

where R', G', B' are 0–1 normalized. This is a mathematical approximation, not a color-managed conversion — real print output also depends on your printer's ICC profile, paper stock, and ink set. Treat the CMYK values from any browser-based converter (including Pigomentry's) as a starting estimate, not a press-ready value.

Which one should you use?

TaskBest space
CSS, HTML, UI designHex / RGB
Building a color scale by hand (lighter/darker variants)HSL
Canvas pixel manipulation, image processingRGB
Sending artwork to a commercial printerCMYK — via your design software's real ICC profile, not a browser approximation
Figures checked 15 Aug 2026. RGB/CMYK gamut sizes and print-vs-screen behavior verified against industry print guides; formulas verified against the standard sRGB/HSL conversion math used in the CSS Color Module. Source: Printful — RGB vs CMYK Color Guide.