Skip to content
color-kitnext
StartAPI
color-kit on GitHub
Start

Concepts

  • OKLCH-canonical
  • Requested vs displayed
  • Planes and queries
  • Gamut and tolerance
  • Contrast

Guides

  • Headless picker
  • React
  • Contrast-aware palettes
  • GPU and three.js
  • Performance

API

  • Overview
  • @pbroom/color-kit
  • @pbroom/color-kit/plane
  • @pbroom/color-kit/interop
  • @pbroom/color-kit/compute
  • @pbroom/color-kit/hct
  • @pbroom/color-kit/driver
      • ffunctiongetColorDisplayHex
      • ffunctiongetColorDisplayStyles
      • ffunctioncolorsEqual
      • ffunctioncreateColorState
      • ffunctiongetActiveDisplayedColor
      • ffunctionmapDisplayedColors
      • ffunctionresolveColorSource
      • ffunctionresolveIncomingRequested
      • ffunctionsetColorActiveGamut
      • ffunctionsetColorActiveView
      • ffunctionsetColorChannel
      • ffunctionsetColorRequested
      • IinterfaceColorDisplayStyles
      • TtypeColorChannel
      • TtypeColorInteraction
      • TtypeColorSource
      • IinterfaceColorState
      • IinterfaceColorUpdateEvent
      • IinterfaceCreateColorStateOptions
      • TtypeGamutTarget
      • IinterfaceMapDisplayedColorsOptions
      • IinterfaceResolveIncomingRequestedOptions
      • IinterfaceSetColorRequestedOptions
      • TtypeViewModel
  • @pbroom/color-kit/react
Map

@pbroom/color-kit/driver/Color state

ColorSource

Who caused a state change: 'user' (direct interaction), 'programmatic' (set by code, e.g. a controlled prop) or 'derived' (computed from another change). See resolveColorSource.

typeimport type { ColorSource } from '@pbroom/color-kit/driver';color-state.ts:26
type ColorSource = 'user' | 'programmatic' | 'derived';

Also exported from

  • @pbroom/color-kit/reactthe same declaration, re-exported

Your display: detecting

MIT licensedSource