@pbroom/color-kitConversion

p3ToLinearP3

Linearize gamma-encoded Display P3 with the inverse P3 transfer function (the same curve as sRGB). Unclamped; out-of-range inputs extend the curve.

functionimport { p3ToLinearP3 } from '@pbroom/color-kit';p3.ts:220
function p3ToLinearP3(p3: P3): P3;

Parameters

p3P3
Gamma-encoded Display P3 color

Returns

P3A new linear-light P3

Example

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

p3ToLinearP3({ r: 1, g: 0.5, b: 0, alpha: 1 }); // → ≈ { r: 1, g: 0.214, b: 0, alpha: 1 }

See also