You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.
After more playing around I've found I need to be dividing my HSL values, but I'm still getting weird results; when compare to colorsys conversion (where I get the correct result).
For example:
from colormath.color_conversions import convert_color
import colorsys
from colormath.color_objects import LabColor, HSLColor, sRGBColor
h = 89
s = 19
l = 90
color = HSLColor(h/360, s/100, l/100)
lab1 = convert_color(color, LabColor)
print(lab1)
r, g, b = colorsys.hls_to_rgb(h/360, l/100, s/100)
lab2 = convert_color(sRGBColor(r, g, b), LabColor)
print(r, g, b)
print(lab2)
If I try to convert from HSL I get some weird outputs:
For example:
Output looks like this:
As you can see this is obviously wrong, and when I use a tool such as this: http://colormine.org/color-converter I get results of:
The text was updated successfully, but these errors were encountered: