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_SLIDER_DEFAULT_RANGES
      • ffunctioncolorFromColorSliderKey
      • ffunctioncolorFromColorSliderPosition
      • ffunctiongetColorSliderLabel
      • ffunctiongetColorSliderValueText
      • ffunctiongetColorSliderNormFromValue
      • ffunctiongetColorSliderThumbPosition
      • ffunctionnormalizeColorSliderPointer
      • ffunctionresolveColorSliderRange
      • ffunctionresolveColorSliderWrap
      • TtypeColorSliderChannel
      • TtypeColorSliderKey
      • IinterfaceColorSliderKeyOptions
      • TtypeColorSliderOrientation
  • @pbroom/color-kit/react
Map

@pbroom/color-kit/driver/Color slider

getColorSliderLabel

Default accessible label for a slider channel: 'Lightness', 'Chroma', 'Hue' or 'Opacity'.

functionimport { getColorSliderLabel } from '@pbroom/color-kit/driver';color-slider.ts:91
function getColorSliderLabel(  channel: ColorSliderChannel,): string;

Parameters

channelColorSliderChannel

Returns

string

Example

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

getColorSliderLabel('alpha'); // → 'Opacity'

Your display: detecting

MIT licensedSource