One color, every model
A color model is a way of describing a color as numbers. The same patch of color can be written as RGB for screens, CMYK for print, HSL or HSV for human-friendly editing, and LAB or LCH for perceptual work. This reference takes one sRGB color and expresses it in each model so you can see how the numbers relate — and lists the conversion formula behind every translation.
How it works
Everything starts from RGB in the 0–255 range, normalised to 0–1.
- HSL / HSV share a hue computed from which channel is largest. For HSL, lightness is the average of the max and min channels; for HSV, value is simply the max. Saturation is derived differently in each so that HSL peaks at mid lightness and HSV peaks at full value.
- CMYK uses
K = 1 − max(R,G,B), thenC = (1−R−K)/(1−K)and likewise for M and Y, with all-black handled as a special case. - XYZ requires linearising sRGB (undoing the gamma curve) and multiplying by the sRGB-to-XYZ matrix under the D65 white point.
- LAB transforms XYZ through a cube-root non-linearity relative to the reference white, producing
L*(lightness 0–100),a*(green–red) andb*(blue–yellow).
Tips and notes
Use HSL when you need readable shade ramps — fix hue and saturation, step lightness. Reach for LAB or LCH when you care about even perceived steps, such as data-visualisation palettes, because equal RGB steps look uneven to the eye. Treat CMYK output as indicative only: accurate print color needs the press’s ICC profile. When converting in code, always linearise sRGB before any matrix math, and de-linearise on the way back, or your XYZ and LAB values will be wrong.