@pbroom/color-kit/planeQueries
inspectPlaneQueries
Runs several plane queries in order, returning a result and trace for each.
import { inspectPlaneQueries } from '@pbroom/color-kit/plane';query.ts:228function inspectPlaneQueries(
planeDefinition: PlaneDefinition,
queries: PlaneQuery[],
options?: PlaneQueryTraceOptions,
): PlaneQueryInspection<PlaneQueryResult>[];Equivalent to mapping inspectPlaneQuery over queries with the same trace options; each query gets its own independent trace.
Parameters
- planeDefinition
PlaneDefinition - Plane to query; a
Planeor anyPlaneDefinition. - queries
PlaneQuery[] - Query payloads to run.
- options?
PlaneQueryTraceOptions - Trace detail applied to every query; see
inspectPlaneQuery.
Returns
PlaneQueryInspection<PlaneQueryResult>[]A new array of { result, trace } pairs, 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 { parse } from '@pbroom/color-kit';
import { definePlane, inspectPlaneQueries } from '@pbroom/color-kit/plane';
const plane = definePlane({ fixed: { h: 264 } });
const inspections = inspectPlaneQueries(
plane,
[
{ kind: 'gamutBoundary' },
{ kind: 'contrastRegion', reference: parse('#ffffff') },
],
{ level: 'summary' },
);
inspections.map(({ trace }) => trace.summary.resultPointCount); // → [101, 53]
inspections.map(({ trace }) => trace.stages.length); // → [0, 0]Also exported from
@pbroom/color-kitthe same declaration, re-exported