Skip to content

Out-of-gamut oklch

Lightness and hue are fixed; chroma rises from 0 up to the slider’s value across the row. Push the slider up and watch the right-hand swatches stop changing — that flat tail is sRGB clipping, not a rendering bug.

@kurkle/color clips out-of-gamut oklch() colours to sRGB, the same way a browser clips them when painting a <canvas>, rather than running the CSS gamut-mapping algorithm a browser uses for color: oklch(...) on an element. Measured against Chromium and Firefox, the canvas result matches this package, not the gamut-mapped one.