@pbroom/color-kit/planeQueries
runPlaneQueries
Runs several plane queries against one plane, in order.
import { runPlaneQueries } from '@pbroom/color-kit/plane';query.ts:120function runPlaneQueries(
planeDefinition: PlaneDefinition,
queries: PlaneQuery[],
): PlaneQueryResult[];Equivalent to mapping runPlaneQuery over queries.
Parameters
- planeDefinition
PlaneDefinition - Plane to query; a
Planeor anyPlaneDefinition. - queries
PlaneQuery[] - Query payloads to run.
Returns
PlaneQueryResult[]A new array with one result per query, in input order.
Throws
- When a query's
gamutis not'srgb'or'display-p3'. - When a query kind is unknown or the plane or query options are invalid.
Example
import { definePlane, runPlaneQueries } from '@pbroom/color-kit/plane';
const plane = definePlane({ fixed: { h: 264 } });
const results = runPlaneQueries(plane, [
{ kind: 'gamutBoundary', gamut: 'display-p3' },
{ kind: 'chromaBand', requestedChroma: 0.1 },
]);
results.map((result) => result.kind); // → ['gamutBoundary', 'chromaBand']Also exported from
@pbroom/color-kitthe same declaration, re-exported