fromP3Into
Convert Display P3 (gamma-encoded, 0-1) to a Color, writing into out (allocation-free). Bit-identical to fromP3.
import { fromP3Into } from '@pbroom/color-kit';into.ts:206function fromP3Into( out: Color, , p3: P3,): Color;Parameters
Returns
Colorout
Example
import { fromP3Into, toCss } from '@pbroom/color-kit';
const color = { l: 0, c: 0, h: 0, alpha: 1 };
fromP3Into(color, { r: 1, g: 0, b: 0, alpha: 1 });
toCss(color, 'oklch'); // → 'oklch(0.6486 0.2995 28.96)'