@pbroom/color-kit/driverColor state

getActiveDisplayedColor

Returns the displayed color for the state's active gamut: displayed.p3 for 'display-p3', otherwise displayed.srgb.

functionimport { getActiveDisplayedColor } from '@pbroom/color-kit/driver';color-state.ts:245
function getActiveDisplayedColor(  state: ColorState,): Color;

Parameters

Returns

Color

Example

TypeScript
import { toHex } from '@pbroom/color-kit';
import {
  createColorState,
  getActiveDisplayedColor,
  setColorActiveGamut,
} from '@pbroom/color-kit/driver';

const state = createColorState({ l: 0.75, c: 0.22, h: 150, alpha: 1 });
getActiveDisplayedColor(state).c; // → 0.22 (inside P3, unchanged)
const srgb = setColorActiveGamut(state, 'srgb', 'user');
toHex(getActiveDisplayedColor(srgb)); // → '#00d061'