toP3Gamut
Map a Color to the Display P3 gamut. Same methods and options as toSrgbGamut; the default reduces OKLCH chroma at fixed L and h.
import { toP3Gamut } from '@pbroom/color-kit';membership.ts:409function toP3Gamut(color: Color): Color;
function toP3Gamut(
color: Color,
options: GamutMapOptions | undefined,
): Color;Colors already in gamut (per inP3Gamut) are returned unchanged. Returns a new object.
Overload 1 of 2
Parameters
Returns
Overload 2 of 2
Parameters
- options
GamutMapOptions | undefined
Returns
Example
import { toP3Gamut } from '@pbroom/color-kit';
toP3Gamut({ l: 0.7, c: 0.35, h: 150, alpha: 1 });
// → { l: 0.7, c: ≈ 0.2689, h: 150, alpha: 1 }