SetRequestedOptions
Options for the UseColorReturn and UseMultiColorReturn setters.
import type { SetRequestedOptions } from '@pbroom/color-kit/react';use-color.ts:83interface SetRequestedOptions {
changedChannel?: ColorChannel;
interaction?: ColorInteraction;
source?: ColorSource;
explicitHue?: boolean;
}Properties
- changedChannel?
ColorChannel - Channel reported as
changedChannelon 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
falseand the new color is achromatic, the latest requested hue is kept, so raising chroma later resumes it.Defaults to
trueforsetRequested(an OKLCH object states its hue), to whether the string is anoklch()with a hue other thannoneforsetFromString, and tofalseforsetFromRgb/setFromHsl/setFromHsv. Passtrueto store the converted hue (0for grays).