Function toOklab

Converts OKLCH to Cartesian Oklab coordinates.

Oklab!T toOklab(T)(
  Oklch!T color
) pure nothrow @nogc @safe;

Use this when an OKLCH value must enter an Oklab-based calculation or conversion path. Complete hue revolutions represent the same direction and do not modify the stored OKLCH value. Negative chroma remains valid raw mathematical input.

Parameters

NameDescription
color OKLCH value to convert.

Returns

The corresponding Cartesian Oklab value.

See Also

toOklch

Example

const neutral = Oklchd(
    0.5,
    0.0,
    OklabHued.fromDegrees(725.0)
).toOklab;

assert(neutral == Oklabd(0.5, 0.0, 0.0));