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
      • KconstCOLOR_INPUT_DEFAULT_RANGES
      • ffunctioncolorFromColorInputChannelValue
      • ffunctioncolorFromColorInputKey
      • ffunctionformatColorInputChannelValue
      • ffunctiongetColorInputChangedChannel
      • ffunctiongetColorInputChannelGlyph
      • ffunctiongetColorInputChannelValue
      • ffunctiongetColorInputLabel
      • ffunctiongetColorInputPrecisionFromStep
      • ffunctionnormalizeColorInputValue
      • ffunctionparseColorInputExpression
      • ffunctionresolveColorInputDraftValue
      • ffunctionresolveColorInputRange
      • ffunctionresolveColorInputSteps
      • ffunctionresolveColorInputWrap
      • TtypeColorInputModel
      • TtypeColorInputChannel
      • TtypeColorInputChannelFor
      • IinterfaceColorInputPrimitiveExpressionOptions
      • TtypeColorInputSpec
      • TtypeOklchColorInputChannel
      • TtypeRgbColorInputChannel
      • TtypeHslColorInputChannel
      • TtypeColorInputKey
      • IinterfaceColorInputStepConfig
      • IinterfaceResolveColorInputStepsOptions
      • IinterfaceParseColorInputExpressionOptions
      • IinterfaceResolveColorInputDraftValueOptions
  • @pbroom/color-kit/react
Map

@pbroom/color-kit/driver/Color input

ColorInputSpec

A valid model/channel pair, e.g. { model: 'hsl', channel: 's' }. The union is discriminated on model.

typeimport type { ColorInputSpec } from '@pbroom/color-kit/driver';color-input.ts:54
type ColorInputSpec<Model extends ColorInputModel = ColorInputModel> = { [Key in Model]: { model: Key; channel: ColorInputChannelFor<Key> } }[Model];

Your display: detecting

MIT licensedSource