HPLuv
The HPLuv color space is not registered in Color
by default
Properties
Name: hpluv
Color CSS ID: --hpluv
White Point: D65 / 2˚
Coordinates:
Name | Range |
---|---|
h | [0, 360) |
p | [0, 100] |
l | [0, 100] |
HPLuv is similar to HSLuv but takes as many colors as it can from CIELChuv without distorting the chroma. This ends up reducing the gamut to a subset of the sRGB gamut. In the end, only more pastel colors remain.
Channel Aliases
Channels | Aliases |
---|---|
h | hue |
p | perpendiculars |
l | lightness |
Inputs/Output
HPLuv is not currently supported in the CSS spec, the parsed input and string output formats use the color()
function format using the custom name --hpluv
:
color(--hpluv h p l / a) // Color function
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("hpluv", [0, 0, 0], 1)
The string representation of the color object and the default string output use the color(--hpluv h p l / a)
form.
>>> Color("hpluv", [23.881, 100, 53.237])
color(--hpluv 23.881 100 53.237 / 1)
>>> Color("hpluv", [49.45, 100, 74.934]).to_string()
'color(--hpluv 49.45 100 74.934)'
Registering
from coloraide import Color as Base
from coloraide.spaces.hpluv import HSPLuv
class Color(Base): ...
Color.register(HPLuv())