The oklab()
functional notation expresses a given color in the Oklab color space, which attempts to mimic how color is perceived by the human eye. The oklab()
works with a Cartesian coordinate system on the Oklab color space, the a- and b-axes. If you want a polar color system, chroma and hue, use oklch()
.
Oklab is a perceptual color space and is useful to:
- Transform an image to grayscale, without changing its lightness.
- Modify the saturation of colors, while keeping user perception of hue and lightness
- Create smooth and uniform gradients of colors (when interpolated manually, for example, in a
<canvas>
element).
The function oklab()
can represent any color from the Oklab color space that is wider than RGB and include wide gamut and P3 colors.