@pbroom/color-kit/reactColor

SetRequestedOptions

Options for the UseColorReturn and UseMultiColorReturn setters.

interfaceimport type { SetRequestedOptions } from '@pbroom/color-kit/react';use-color.ts:83
interface SetRequestedOptions {
  changedChannel?: ColorChannel;
  interaction?: ColorInteraction;
  source?: ColorSource;
  explicitHue?: boolean;
}

Properties

changedChannel?ColorChannel
Channel reported as changedChannel on the update event.
interaction?ColorInteractiondefault 'programmatic' (`'text-input'` for `setFromString`)
Input that caused the update, reported on the update event.
source?ColorSource
Source recorded in state.meta.source. Defaults to 'user' for pointer, keyboard and text-input interactions and 'programmatic' otherwise.
explicitHue?boolean

Whether the new color's hue is an OKLCH hue the caller stated. When false and the new color is achromatic, the latest requested hue is kept, so raising chroma later resumes it.

Defaults to true for setRequested (an OKLCH object states its hue), to whether the string is an oklch() with a hue other than none for setFromString, and to false for setFromRgb / setFromHsl / setFromHsv. Pass true to store the converted hue (0 for grays).