@pbroom/color-kit/driverColor slider
getColorSliderValueText
Human-readable aria-valuetext for a slider value, e.g. "Hue 213°", "Lightness 60%", "Opacity 50%", "Chroma 0.2". Lightness and alpha are shown as percentages, hue in whole degrees, chroma to three decimals.
import { getColorSliderValueText } from '@pbroom/color-kit/driver';color-slider.ts:108function getColorSliderValueText(
channel: ColorSliderChannel,
value: number,
): string;Parameters
- value
number
Returns
string
Example
import { getColorSliderValueText } from '@pbroom/color-kit/driver';
getColorSliderValueText('h', 213.4); // → 'Hue 213°'
getColorSliderValueText('c', 0.12345); // → 'Chroma 0.123'