toLinearSrgbInto
Convert a Color to unclamped linear-light sRGB (0-1, may fall outside that range for out-of-gamut colors), writing into out (allocation-free).
import { toLinearSrgbInto } from '@pbroom/color-kit';into.ts:98function toLinearSrgbInto( out: LinearRgb, , color: Color,): LinearRgb;Parameters
Returns
LinearRgbout
Example
import { parse, toLinearSrgbInto } from '@pbroom/color-kit';
const linear = { r: 0, g: 0, b: 0, alpha: 1 };
toLinearSrgbInto(linear, parse('color(display-p3 1 0 0)'));
linear.r; // → ≈ 1.2249 (outside sRGB, not clipped)