toHsv
Convert a Color to HSV/HSB (hue in degrees, saturation and value 0-100).
import { toHsv } from '@pbroom/color-kit';index.ts:223function toHsv(color: Color): Hsv;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, toHsv } from '@pbroom/color-kit';
toHsv(parse('#3b82f6')); // → ≈ { h: 217.22, s: 76.02, v: 96.47, alpha: 1 }