@pbroom/color-kitConversion

linearSrgbToLinearP3

Convert linear-light sRGB to linear-light Display P3 with the combined P3fromXYZ · sRGBtoXYZ matrix from CSS Color 4. Unclamped.

functionimport { linearSrgbToLinearP3 } from '@pbroom/color-kit';p3.ts:64
function linearSrgbToLinearP3(  rgb: LinearRgb,): P3;

Parameters

rgbLinearRgb
Linear-light sRGB color

Returns

P3A new linear-light P3

Example

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

linearSrgbToLinearP3({ r: 1, g: 0, b: 0, alpha: 1 });
// → ≈ { r: 0.8225, g: 0.0332, b: 0.0171, alpha: 1 }

See also