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
def rgb2hsv(self, r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = round((df/mx) * 100, 1)
v = mx * 100
return round(h), s, v
and for
def get_rgb_from_xy_and_brightness(...)
...
r = X * 3.2406 - Y * 1.5372 - Z * 0.4986;
g = -X * 0.9689 + Y * 1.8758 + Z * 0.0415;
b = X * 0.0557 - Y * 0.2040 + Z * 1.0570;
...
RGB to xy conversion seems buggy. rgb = (0, 255, 0) results in some kind of yellow
The text was updated successfully, but these errors were encountered: