Okhsv
The Okhsv color space is not registered in Color
by default
Properties
Name: okhsv
White Point: D65 / 2˚
Coordinates:
Name | Range |
---|---|
h | [0, 360) |
s | [0, 1] |
v | [0, 1] |
Okhsv was created by Björn Ottosson and is a transform of the Oklab color space that approximates the sRGB gamut perceptually in an HSL color model. The aim was to create a color space that was better suited for being used in color pickers than the current HSV.
Channel Aliases
Channels | Aliases |
---|---|
h | hue |
s | saturation |
v | value |
Input/Output
Okhsv is not currently supported in the CSS spec, the parsed input and string output formats use the color()
function format using the custom name --okhsv
:
color(--okhsv h s 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("okhsv", [0, 0, 0], 1)
The string representation of the color object and the default string output use the color(--okhsv h s l / a)
form.
>>> Color("okhsv", [29.234, 1, 1])
color(--okhsv 29.234 1 1 / 1)
>>> Color("okhsv", [70.67, 1, 1]).to_string()
'color(--okhsv 70.67 1 1)'
Registering
from coloraide import Color as Base
from coloraide.spaces.okhsv import Okhsv
class Color(Base): ...
Color.register(Okhsv())