linearSrgbToLinearP3Into
Convert linear sRGB to linear Display P3, writing into out (allocation-free). Combined P3fromXYZ · sRGBtoXYZ matrix from CSS Color Level 4. out may be the same object as rgb.
import { linearSrgbToLinearP3Into } from '@pbroom/color-kit';p3.ts:34function linearSrgbToLinearP3Into( out: P3, , rgb: LinearRgb,): P3;Parameters
Returns
P3out
Example
import { linearSrgbToLinearP3Into } from '@pbroom/color-kit';
const p3 = { r: 0, g: 0, b: 0, alpha: 1 };
linearSrgbToLinearP3Into(p3, { r: 1, g: 0, b: 0, alpha: 1 });
p3.r; // → ≈ 0.8225