@pbroom/color-kit/driverMulti color

setMultiColorActiveView

Switches the shared view model and sets every entry's source to source. No-op when the view is unchanged, whatever source is.

functionimport { setMultiColorActiveView } from '@pbroom/color-kit/driver';multi-color-state.ts:492
function setMultiColorActiveView(
  model: MultiColorModel,
  view: ViewModel,
  source: ColorSource,
): MultiColorModel;

Parameters

Returns

MultiColorModel

Example

TypeScript
import {
  createMultiColorModel,
  setMultiColorActiveView,
} from '@pbroom/color-kit/driver';

const model = createMultiColorModel({ colors: { bg: '#ffffff', fg: '#3b82f6' } });
const next = setMultiColorActiveView(model, 'hsl', 'user');
next.activeView; // → 'hsl'
next.entries.bg.source; // → 'user'