@pbroom/color-kit/driverColor area
getColorAreaFallbackPoint
Maps query.color into the requested gamut and returns its thumb position, e.g. to show where an out-of-gamut selection will actually render.
import { getColorAreaFallbackPoint } from '@pbroom/color-kit/driver';color-area.ts:699function getColorAreaFallbackPoint(
axes: ResolvedColorAreaAxes,
query: { color: Color; gamut: GamutTarget },
): ColorAreaFallbackPoint;Parameters
- query
{ color: Color; gamut: GamutTarget }
Returns
Throws
- When
query.gamutis missing or is not'srgb'or'display-p3'(for example the removed'p3'spelling), matching the core plane queries.
Example
import { getColorAreaFallbackPoint, resolveColorAreaAxes } from '@pbroom/color-kit/driver';
const point = getColorAreaFallbackPoint(resolveColorAreaAxes(), {
color: { l: 0.7, c: 0.35, h: 150, alpha: 1 },
gamut: 'srgb',
});
point.x; // → 0.7
point.y.toFixed(3); // → '0.518'
point.color.c.toFixed(4); // → '0.1928'