toP3Into
Convert a Color to Display P3 (gamma-encoded, clamped to 0-1 like toP3), writing into out (allocation-free).
import { toP3Into } from '@pbroom/color-kit';into.ts:182function toP3Into( out: P3, , color: Color,): P3;Parameters
Returns
P3out
Example
import { parse, toP3Into } from '@pbroom/color-kit';
const p3 = { r: 0, g: 0, b: 0, alpha: 1 };
toP3Into(p3, parse('#ff0000'));
p3; // → ≈ { r: 0.9175, g: 0.2003, b: 0.1386, alpha: 1 }