p3ToLinearP3Into
Remove Display P3 gamma encoding to get linear P3, writing into out (allocation-free). out may be the same object as p3.
import { p3ToLinearP3Into } from '@pbroom/color-kit';p3.ts:191function p3ToLinearP3Into( out: P3, , p3: P3,): P3;Parameters
Returns
P3out
Example
import { p3ToLinearP3Into } from '@pbroom/color-kit';
const linear = { r: 0, g: 0, b: 0, alpha: 1 };
p3ToLinearP3Into(linear, { r: 1, g: 0.5, b: 0, alpha: 1 });
linear.g; // → ≈ 0.214