@pbroom/color-kitConversion

fromOklabInto

Convert OKLab to a Color (OKLCH), writing into out (allocation-free). Bit-identical to fromOklab.

functionimport { fromOklabInto } from '@pbroom/color-kit';into.ts:76
function fromOklabInto(  out: Color, ,  lab: Oklab,): Color;

Parameters

outColor
Color to write the result into
labOklab
OKLab color

Returns

Colorout

Example

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

const color = { l: 0, c: 0, h: 0, alpha: 1 };
fromOklabInto(color, { L: 0.7, a: 0, b: 0.1, alpha: 1 });
color; // → { l: 0.7, c: 0.1, h: 90, alpha: 1 }