What the color codes mean
Every code above describes the same color in a different coordinate system. Some describe the signal sent to a display; others describe what a standard observer sees.
| Code | What it encodes | Device-independent? | Typical use |
|---|---|---|---|
| HEX | The three sRGB channel values (0–255) written in base 16: #RRGGBB. | Only through sRGB | Web and software colors |
| RGB | Red, green, and blue drive levels, gamma-encoded. #3366CC is R 51, G 102, B 204. | Only when the space is named (sRGB, Adobe RGB, camera RGB) | Displays, cameras, image files |
| HSV / HSB | RGB rearranged as a cylinder: hue angle, saturation, and value (the largest channel). | No, inherits RGB | Color pickers, simple machine-vision thresholds |
| HSL | Like HSV, but lightness is the average of the largest and smallest channels, so full saturation sits at L = 50 %. | No | CSS, design tools |
| CMYK | Cyan, magenta, yellow, and black ink coverage. The formula here is the naive conversion; real printing needs an ICC profile. | No, depends on inks and paper | |
| XYZ | CIE tristimulus values: the eye's response, computed from a spectrum. Y is luminance. | Yes | The hub that every other space converts through |
| xyY | Chromaticity (x, y) plus luminance Y; x and y are XYZ normalized to sum to one. | Yes | Gamut diagrams, LED and display specs |
| CIELAB | L* lightness, a* red–green, b* yellow–blue, built so equal distances look roughly equally different. | Yes, with a stated illuminant and observer | Color tolerances, coatings, plastics, paint, QC |
| LCh | CIELAB in polar form: lightness, chroma (distance from gray), and hue angle. | Yes | Describing shifts as lighter, more saturated, or hue-shifted |
sRGB values are gamma-encoded, so channel value 128 is only about 22 % of full light. Conversions to XYZ first linearize each channel,
then apply the sRGB-to-XYZ matrix. CIELAB follows from XYZ and the white point \((X_n, Y_n, Z_n)\):
where \(f(t) = t^{1/3}\) above a small threshold and linear below it. Many CIELAB colors, especially saturated cyans and greens, fall outside sRGB. They cannot be shown exactly on a typical screen or written as a hex code, which is why the converter flags out-of-gamut colors.
Hue in HSV is not hue in CIELAB
HSV and HSL are geometric rearrangements of RGB, not models of perception. A fully saturated yellow and a fully saturated blue both have V = 100 %, but yellow looks far lighter (L* 97 against 32). Equal steps in HSV hue are not equal perceived steps, and HSV hue angles do not match CIELAB hue angles. Use HSV for quick thresholds on images taken under fixed conditions; use CIELAB and ΔE when the numbers must match what people see or what another instrument reports.
Color difference: ΔE*ab and ΔE00
The simplest color difference is the straight-line distance in CIELAB, \(\Delta E^*_{ab} = \sqrt{\Delta L^{*2} + \Delta a^{*2} + \Delta b^{*2}}\). CIELAB is not perfectly uniform: the eye is more sensitive to hue differences near neutral and less sensitive in saturated colors. CIEDE2000 (ΔE00) corrects this with weighting functions for lightness, chroma, and hue and a rotation term for blues. As a rule of thumb, ΔE00 below 1 is not perceptible to most observers, 1–2 is visible on close side-by-side inspection, and above about 3.5 is obvious. Production tolerances are usually set against a master sample and an agreed ΔE, with separate limits on ΔL*, Δa*, and Δb* when one direction matters more.
How instruments measure color
Spectrophotometers measure the reflectance or transmittance spectrum, typically every 10 nm from 360 or 400 to 700 or 780 nm, and compute XYZ by weighting it with a standard illuminant and observer (the method of ASTM E308 and CIE 15). Because they measure the spectrum, any illuminant and observer can be computed afterward, and readings from different instruments agree to within a few tenths of a ΔE when geometry and calibration match. Measurement geometry matters: d/8° integrating-sphere instruments can include (SCI) or exclude (SCE) the specular reflection, while 45°/0° instruments mimic visual viewing and exclude gloss. Always report the illuminant, the observer (2° or 10°), and the geometry with the numbers.
Handheld spectrophotometers are the lab and QC reference. They press against the sample with a fixed aperture and their own calibrated light source. Inline (non-contact) spectrophotometers measure on a moving line from a fixed standoff. They need a stable distance and tilt, a defined geometry, and regular checks against reference tiles, but they give the same device-independent CIELAB as a handheld instrument, continuously.
Cameras report device RGB, not CIE values. A camera's red, green, and blue filters do not match the CIE color-matching functions, and auto exposure, auto white balance, gamma, and changes in lighting all move the numbers. As a result, HSV or RGB values from a camera often have no simple, let alone linear, relationship to CIELAB from a spectrophotometer, even when both track the same physical change. Cameras work well for relative color control: lock exposure, gain, and white balance, use a stable enclosed light source, read linear (raw) values, and compare each part to reference samples in the same image. For absolute color, characterize the camera against a color target to build a correction matrix, and verify it against a spectrophotometer over the range of colors you produce.
Measuring the color of low-e coated glass
A low-e coating is a stack of thin silver and dielectric layers, and its color comes from thin-film interference. A few nanometers of change in a dielectric layer moves a* and b* by a unit or more, so color is one of the most sensitive production checks of coating thickness and uniformity. Silver thickness also sets the sheet resistance and emissivity (see the sheet resistance tool), so color and sheet resistance together track most of what can drift in a coater.
- Measure three things: transmitted color, reflected color from the glass side (what you see from outside when the coating is on surface #2), and reflected color from the film side. They differ, and specifications usually name each one.
- Use specular geometry. Coated glass is mirror-like, so the reflected color lives in the specular component. Use a specular-included (SCI) sphere or a dedicated specular-reflectance geometry. A 45°/0° instrument largely misses it.
- Control the back surface. The second glass surface adds its own reflection. Back the sample with a light trap or black velvet, never a white tile, and state whether the measurement is on monolithic glass or the finished insulating unit, since the second lite and gap change reflected color.
- Watch the angle. Interference colors shift toward blue as viewing angle increases. Measure at the specified angle, usually near-normal, and check off-angle appearance separately if the façade will be seen obliquely.
- Substrate matters. The iron in clear glass tints transmission and glass-side reflection green, so the same coating looks different on clear and low-iron glass and at different thicknesses.
- Map uniformity. Measure several points across the lite and report the spread as ΔE to the center or to a master. Edge and end effects in the coater show up here first.
- Cameras and handhelds together. A camera system under fixed lighting can flag streaks and gradients over the whole lite, while spot measurements with a spectrophotometer anchor the absolute values. Expect to correlate them empirically; the relationship is usually not linear and can differ between coatings.
The glazing performance calculator computes transmitted and reflected CIELAB for full glazing units, and the spectrum panel above converts any measured curve to color.
References
- CIE 015:2018, Colorimetry, 4th ed.; ISO/CIE 11664-4 (CIELAB) and ISO/CIE 11664-6 (CIEDE2000).
- G. Sharma, W. Wu, and E. N. Dalal, “The CIEDE2000 color-difference formula: Implementation notes, supplementary test data, and mathematical observations,” Color Res. Appl. 30, 21–30 (2005).
- IEC 61966-2-1, Default RGB colour space — sRGB.
- ASTM E308, Standard Practice for Computing the Colors of Objects by Using the CIE System; ASTM E1164, Standard Practice for Obtaining Spectrometric Data for Object-Color Evaluation.
- R. S. Berns, Billmeyer and Saltzman's Principles of Color Technology, 4th ed., Wiley (2019).