@pbroom/color-kit/driverColor state
resolveColorSource
Resolves the state source for an interaction. Explicit source wins; otherwise programmatic interactions stay programmatic and everything else counts as user intent.
import { resolveColorSource } from '@pbroom/color-kit/driver';color-state.ts:265function resolveColorSource(
interaction: ColorInteraction,
source?: ColorSource,
): ColorSource;Parameters
Returns
Example
import { resolveColorSource } from '@pbroom/color-kit/driver';
resolveColorSource('pointer'); // → 'user'
resolveColorSource('programmatic'); // → 'programmatic'
resolveColorSource('keyboard', 'derived'); // → 'derived'