HSV
The HSV color space is registered in Color
by default
Properties
Name: hsv
White Point: D65 / 2˚
Coordinates:
Name | Range |
---|---|
h | [0, 360) |
s | [0, 1] |
v | [0, 1] |
HSV is a color space similar to the modern RGB and CMYK models. The HSV color space has three components: hue, saturation and value. 'Value' is sometimes substituted with 'brightness' and then it is known as HSB. HSV models how colors appear under light.
Channel Aliases
Channels | Aliases |
---|---|
h | hue |
s | saturation |
v | value |
Input/Output
HSV is not supported via the CSS spec and the parser input and string output only supports the color()
function format using the custom name --hsv
:
color(--hsv 0 0% 0% / 1)
When manually creating a color via raw data or specifying a color space as a parameter in a function, the color space name is always used:
Color("hsv", [0, 0, 0], 1)
The string representation of the color object and default string output will always use the color(hsv h s v / a)
form.
>>> Color("hsv", [0, 1, 1])
color(--hsv 0 1 1 / 1)
>>> Color("hsv", [38.824, 1, 1]).to_string()
'color(--hsv 38.824 1 1)'
Registering
from coloraide import Color as Base
from coloraide.spaces.hsv import HSV
class Color(Base): ...
Color.register(HSV())