Skip to content

IOKLCH

Type interface

OKLCH color helpers.

OKLCH describes a color by lightness, chroma and hue, derived from Björn Ottosson's OKLab. Unlike in HSL, equal steps of lightness or hue look equally different to the eye, which suits balanced palettes built from one color.

Ranges:

  • l (lightness): 0 (black) .. 1 (white) - c (chroma): 0 (gray) .. ~0.37 (most saturated sRGB) - h (hue): 0 .. 360 degrees

More info: https://bottosson.github.io/posts/oklab/ for the source math

Sources

IOKLCH is an interface: it describes a shape of data and is not imported on its own.

Properties

c

Type number

Chroma, from 0 (gray) to about 0.37 (most saturated).

h

Type number

Hue, from 0 to 360 degrees.

l

Type number

Lightness, from 0 (black) to 1 (white).