@pbroom/color-kit/reactPlane geometry

ContrastRegionMetrics

Per-compute stats passed to UseContrastRegionOptions.onMetrics.

interfaceimport type { ContrastRegionMetrics } from '@pbroom/color-kit/react';use-contrast-region.ts:53
interface 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.
requestIdnumber
Worker request id the result answers.
computeTimeMsnumber
Compute time in milliseconds (non-deterministic).
pathCountnumber
Number of contour paths.
pointCountnumber
Total vertices across all paths.
initialSamplesnumber
Initial samples per gamut chroma extent the solver ran with.
errorTolerancenumber
Chord error tolerance the solver ran with.
maxDepthnumber
Maximum refinement depth the solver ran with.
contrastMetricContrastMetric
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.
qualityColorPlaneQualityLevel
Sampling quality level.
isDraggingboolean
Whether the plane was being dragged.