srgbToLinearChannel
Inverse sRGB / Display P3 transfer function (linearization): gamma-encoded to linear light, for one channel. Extended range with the same sign mirroring as linearToSrgbChannel, of which it is the exact inverse.
import { srgbToLinearChannel } from '@pbroom/color-kit';index.ts:190function srgbToLinearChannel( c: number,): number;Parameters
- c
number - Gamma-encoded channel value (nominally
0-1)
Returns
numberLinear-light channel value
Example
import { srgbToLinearChannel } from '@pbroom/color-kit';
srgbToLinearChannel(0.5).toFixed(4); // → '0.2140'
srgbToLinearChannel(1); // → 1