@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.

functionimport { getColorAreaFallbackPoint } from '@pbroom/color-kit/driver';color-area.ts:699
function getColorAreaFallbackPoint(
  axes: ResolvedColorAreaAxes,
  query: { color: Color; gamut: GamutTarget },
): ColorAreaFallbackPoint;

Parameters

query{ color: Color; gamut: GamutTarget }

Returns

ColorAreaFallbackPoint

Throws

  • When query.gamut is missing or is not 'srgb' or 'display-p3' (for example the removed 'p3' spelling), matching the core plane queries.

Example

TypeScript
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'

See also