Skip to content

OkLrCh

The OkLrCh color space is not registered in Color by default

Properties

Name: oklrch

White Point: D65 / 2˚ / 2˚

Coordinates:

Name Range*
l [0, 1]
c [0, 0.4]
h [0, 360)

* Space is not bound to the range and is only used as a reference to define percentage inputs/outputs in relation to the Display P3 color space.

OkL~r~Ch

Figure 1. The sRGB gamut represented within the OkLrCh color space.

OkLrCh is the polar form of Oklrab.

Learn about OkLrCh

Channel Aliases

Channels Aliases
l lightness
c chroma
h hue

Input/Output

OkLrCh is not currently supported in the CSS spec, the parsed input and string output formats use the color() function format using the custom name --oklrch:

color(--oklrch l a b / a)  // Color function

When manually creating a color via raw data or specifying a color space as a parameter in a function, the color space name is always used:

Color("oklrch", [0, 0, 0], 1)

The string representation of the color object and the default string output use the color(--oklrch l c h / a) form.

>>> Color("oklrch", [0.56808, 0.25768, 29.234])
color(--oklrch 0.56808 0.25768 29.234 / 1)
>>> Color("oklrch", [0.75883, 0.17103, 70.67]).to_string()
'color(--oklrch 0.75883 0.17103 70.67)'
>>> Color("oklrch", [0.9627, 0.21101, 109.77]).to_string(percent=True)
'color(--oklrch 96.27% 52.753% 109.77)'

Registering

from coloraide import Color as Base
from coloraide.spaces.oklrch import OkLrCh

class Color(Base): ...

Color.register(OkLrCh())