toHsl
Convert a Color to HSL (hue in degrees, saturation and lightness 0-100).
import { toHsl } from '@pbroom/color-kit';index.ts:180function toHsl(color: Color): Hsl;Computed from the sRGB value clipped to the gamut like toRgb but not rounded to 8-bit, so channels are fractional. Grays get hue and saturation 0.
Parameters
Returns
Example
import { parse, toHsl } from '@pbroom/color-kit';
toHsl(parse('#3b82f6')); // → ≈ { h: 217.22, s: 91.22, l: 59.8, alpha: 1 }