@pbroom/color-kitUtilities

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.

functionimport { srgbToLinearChannel } from '@pbroom/color-kit';index.ts:190
function srgbToLinearChannel(  c: number,): number;

Parameters

cnumber
Gamma-encoded channel value (nominally 0-1)

Returns

numberLinear-light channel value

Example

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

srgbToLinearChannel(0.5).toFixed(4); // → '0.2140'
srgbToLinearChannel(1); // → 1