toP3
Convert a Color to gamma-encoded Display P3 (0-1 per channel).
import { toP3 } from '@pbroom/color-kit';index.ts:402function toP3(color: Color): P3;Channels outside the P3 gamut are clipped to [0, 1]; values are not rounded. Use toP3Gamut first for a perceptual gamut map instead of a clip.
Parameters
Returns
Example
import { parse, toP3 } from '@pbroom/color-kit';
toP3(parse('#ff0000')); // → ≈ { r: 0.9175, g: 0.2003, b: 0.1386, alpha: 1 }