@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.

functionimport { resolveColorSource } from '@pbroom/color-kit/driver';color-state.ts:265
function resolveColorSource(
  interaction: ColorInteraction,
  source?: ColorSource,
): ColorSource;

Parameters

Returns

ColorSource

Example

TypeScript
import { resolveColorSource } from '@pbroom/color-kit/driver';

resolveColorSource('pointer'); // → 'user'
resolveColorSource('programmatic'); // → 'programmatic'
resolveColorSource('keyboard', 'derived'); // → 'derived'