@pbroom/color-kit/reactPlane geometry
ContrastRegionMetrics
Per-compute stats passed to UseContrastRegionOptions.onMetrics.
import type { ContrastRegionMetrics } from '@pbroom/color-kit/react';use-contrast-region.ts:53interface ContrastRegionMetrics {
source: 'sync' | 'worker';
requestId: number;
computeTimeMs: number;
pathCount: number;
pointCount: number;
initialSamples: number;
errorTolerance: number;
maxDepth: number;
contrastMetric: ContrastMetric;
backend?: 'js';
scheduleReason?: string;
schedulerBucketCount?: number;
quality: ColorPlaneQualityLevel;
isDragging: boolean;
}Properties
- source
'sync' | 'worker' - Whether the paths came from the main-thread or the worker compute.
- requestId
number - Worker request id the result answers.
- computeTimeMs
number - Compute time in milliseconds (non-deterministic).
- pathCount
number - Number of contour paths.
- pointCount
number - Total vertices across all paths.
- initialSamples
number - Initial samples per gamut chroma extent the solver ran with.
- errorTolerance
number - Chord error tolerance the solver ran with.
- maxDepth
number - Maximum refinement depth the solver ran with.
- contrastMetric
ContrastMetric - Contrast metric the region was solved with.
- backend?
'js' - Compute backend that ran the worker query, when reported.
- scheduleReason?
string - Worker scheduler telemetry; only with
includeSchedulerTelemetry. - schedulerBucketCount?
number - Worker scheduler telemetry; only with
includeSchedulerTelemetry. - quality
ColorPlaneQualityLevel - Sampling quality level.
- isDragging
boolean - Whether the plane was being dragged.