oklch() is a CSS color function based on the Oklab perceptual color space, modeling lightness, chroma, and hue to match human vision. Unlike RGB, adjusting brightness in oklch requires changing only one value (L), making color manipulation more predictable and accessible. It supports a wider color gamut including Display-P3 colors, though it has limitations with gradients due to its polar hue dimension. It's backwards compatible in modern browsers for sRGB displays and is positioned as a useful tool for designers and UI engineers rather than an immediate replacement for RGB.

3m read timeFrom spin.atomicobject.com
Post cover image
Table of contents
What is it?AdvantagesA Pro and a ConDisadvantagesoklch CSS Color
6 Comments

Sort: