Module color.hsv

HSV color values and conversion to and from encoded sRGB.

HSV is provided for interoperability, color-pickers, and tools that express color by hue, saturation, and value/brightness. It is not a perceptual replacement for Oklab or OKLCH. Hue is stored in degrees; conversion normalizes complete revolutions and canonicalizes achromatic colors to hue 0.

Functions

NameDescription
toHsv(color) Converts encoded sRGB to HSV.
toSRgb(color) Converts HSV to encoded sRGB without clipping or gamut mapping.

Structs

NameDescription
Hsv HSV values with hue in degrees and saturation/value as ratios.

Aliases

NameTypeDescription
Hsvd Hsv!(double) HSV with double components.
Hsvf Hsv!(float) HSV with float components.