@pbroom/color-kitConversion

linearP3ToP3

Gamma-encode linear-light Display P3 with the P3 transfer function (the same curve as sRGB). Channels are clamped to [0, 1].

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

Parameters

linearP3
Linear-light Display P3 color

Returns

P3A new gamma-encoded P3

Example

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

linearP3ToP3({ r: 0.2, g: 0.5, b: 0.8, alpha: 1 });
// → ≈ { r: 0.4845, g: 0.7354, b: 0.9063, alpha: 1 }

See also