@pbroom/color-kitConversion

oklabToLinearRgbInto

Convert OKLAB to linear sRGB, writing into out (allocation-free). The result is unclamped, so out-of-gamut colors keep channels outside [0, 1].

functionimport { oklabToLinearRgbInto } from '@pbroom/color-kit';oklab.ts:103
function oklabToLinearRgbInto(  out: LinearRgb, ,  lab: Oklab,): LinearRgb;

Parameters

outLinearRgb
Object to write the result into
labOklab
OKLab color

Returns

LinearRgbout

Example

TypeScript
import { oklabToLinearRgbInto } from '@pbroom/color-kit';

const linear = { r: 0, g: 0, b: 0, alpha: 1 };
oklabToLinearRgbInto(linear, { L: 0.7, a: 0.1, b: 0.1, alpha: 1 });
linear.r; // → ≈ 0.785

See also