Convert standard RGB color definitions into OKLab, a perceptually uniform color space built to keep hue steady as lightness and chroma change.
Input formats
Provide colors using the standard rgb(r, g, b) syntax with channel values ranging from 0 to 255. Each line is parsed independently in batch mode.
OKLab output
rgb(255, 87, 51) becomes oklab(68.04% 0.1747 0.1165). Lightness prints as a percentage; the a and b axes print as small signed numbers, usually within about -0.4 to 0.4.
Smoother color blends
Averaging RGB channels directly can produce a grayish or overly saturated midpoint between two colors. Averaging the same two colors in OKLab space keeps the perceived brightness and hue more consistent along the transition, which is the reasoning behind CSS Color 4 defaulting some interpolation modes to OKLab.