Color and design guides

Desaturate a blue and test the sRGB boundary for red

·

Saturation and chroma both describe how far a color is from gray, using different coordinates. Compare the results and check which OKLCH requests fit the sRGB output.

Color Saturator and Desaturator

Remove color from the sample blue in both models

Select Load example. The base #33669980 has HSL saturation of 50% and lightness of 40%. The −50 point adjustment takes the HSL saturation to zero, giving #66666680.

Keep the adjustment and select OKLCH. The same input has OKLCH chroma of about 0.0987. The requested reduction is 0.2, so chroma stops at zero. At the original OKLCH lightness the gray becomes #63636380.

CSS Color Level 4 — HSL colorsCSS Color Level 4 — Oklab and OKLCH

Read the requested and fitted chroma for red

With OKLCH selected, enter #FF0000 and set an adjustment of 20 points. The request adds 0.08 to chroma, moving it to about 0.3377. The sRGB result stays #FF0000.

The fitted chroma is about 0.2577 at the same requested lightness and hue. The browser displays and exports the fitted color. Compare both coordinate readouts to see why moving the slider may stop changing the output.

CSS Color Level 4 — Oklab and OKLCHBjörn Ottosson — A perceptual color space for image processing

Choose a hue before adding color to gray

Switch to HSL. Enter #808080, set the adjustment to 50 and set Hue for gray to 120 degrees. The new color is #41C041. Choose a different angle to change the color while keeping the same HSL lightness.

Download color-saturation.css to save the source and adjusted values. The adjusted variable uses the same sRGB channels as the swatch.

CSS Color Level 4 — HSL colors

Common questions

Is an OKLCH adjustment a percentage of the original chroma?

It adds or subtracts a fixed amount. One point is 0.004 chroma, the CSS scale where 100% is 0.4.

Can changing saturation increase the opacity?

The adjustment keeps the source alpha. Set an opaque preview background to compare its appearance with the same alpha before and after.

How is the sRGB result chosen for an out-of-range request?

The tool reduces chroma along the requested OKLCH hue and lightness until the color fits sRGB, then rounds RGB channels to bytes.

Sources

Put it into practice.

Related guides