Color_Interpolation module

linear_srgb_to_oklab

procedure · 1 overloadSource

Converts a linear-light sRGB color to Oklab: x is lightness (0 for black, about 1 for white), y and z the green-red and blue-yellow axes. The input must be linear, not gamma-encoded; see Srgb.srgb_to_linear. The transform runs in float64 and rounds to float at the end.

ExampleOpen in playground ↗
#import "Math";
white := linear_srgb_to_oklab(xyz(1, 1, 1));
assert(abs(white.x - 1) < 0.001 && abs(white.y) < 0.001 && abs(white.z) < 0.001);
linear_srgb_to_oklab :: (c: Vector3) -> Vector3

Parameters

Returns

See also