colour
colour copied to clipboard
HSV support
Is HSV going to be supported? The readme says it is supported, but I found only HSL implemented.
Thank you.
In case anyone is looking for HSV support in the meanwhile, the package spectra provides it.
Oups, your question somehow slipped through. HSV is very close to HSL, implementing it could be relatively easily. Why not try to contribute a PR ?
I didn't know about spectra, it's indeed very close to colour
. Thank you for the information of its existence.
I'll do the implementation myself if I have some time.
Bump.
I think the only issue with this is that at the moment attributes are intuitively named under HSL - if HSV was implemented, "saturation" would be duplicated and the naming would no longer be intuitive.
I propose a:
-
color.hsv_saturation
-
color.hsl_saturation
While keeping
-
color.saturation
a synonym for backwards compatibility.
This could be extended to more attributes for coherence's sake. But I dislike the idea to have it everywhere.
for anyone who search for hsv support, python have colorsys.rgb_to_hsv
, example:
>>> import colorsys
>>> from colour import Color
>>> v = Color(rgb=(1, 0, 0)).rgb
>>> hsv = colorsys.rgb_to_hsv(v[0]/255, v[1]/255, v[2]/255)
(0.0, 1.0, 0.00392156862745098)