Primary references
These sources support the standards and technical explanations in this guide. Color Pick recommendations and product-specific limitations are identified separately in the article.
Compare how CSS color-mix() behaves in sRGB, linear sRGB, Oklab, OKLCH, Lab, LCH, HSL, and Display P3, including hue routes and fallback planning.
The interpolation space controls the path between source colors. sRGB mixes encoded RGB channels and can create dark or dull midpoints. Linear sRGB changes the light behavior. Oklab and OKLCH are designed for perceptual uniformity, while polar spaces also require a hue route. Compare the resolved output rather than choosing a space by name alone.
The same endpoints can create different midpoints.
A color mix is not merely an average of labels. The browser converts colors into the selected interpolation space, blends the channels, then resolves the result for display. Encoded sRGB, linear-light RGB, rectangular perceptual spaces, and polar spaces follow different paths.
Each space is useful for a different relationship.
| Space | Strength | Review |
|---|---|---|
| sRGB | Familiar and widely used | Can produce darker or muddier midpoints |
| linear sRGB | Light-energy interpolation | May look brighter than expected |
| Oklab | Perceptual rectangular interpolation | Good default for many UI relationships |
| OKLCH | Perceptual lightness, chroma, and hue | Review hue route and gamut |
| HSL | Familiar hue control | Not perceptually uniform |
| Display P3 | Wide-gamut RGB interpolation | Keep an sRGB fallback |
Polar spaces can travel around the hue circle in more than one direction.
Choose the result based on rendered evidence.
Use the same source colors and percentage.
Resolve the mix in several spaces.
Compare lightness, saturation, hue path, and gamut.
Check contrast on the real surface.
Keep a deterministic fallback before the dynamic expression.
The fallback remains usable when color-mix() is unavailable.
.button {
background: #315fbe;
}
@supports (color: color-mix(in oklch, black, white)) {
.button {
background: color-mix(in oklch, var(--brand) 72%, var(--accent));
}
}Perceptual interpolation does not automatically create sufficient contrast.
Resolve the same mix across modern CSS color spaces.
No. OKLCH exposes chroma and hue directly, which is useful for design recipes. Oklab can avoid hue-route decisions for some blends. Compare the output.
sRGB channels are gamma encoded. Averaging encoded channels does not produce the same light behavior as linear-light interpolation.
Current CSS syntax can accept multiple colors, but browser support for every variation should be tested. The Lab focuses its production compiler on two-source relationships.
These sources support the standards and technical explanations in this guide. Color Pick recommendations and product-specific limitations are identified separately in the article.