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
Hi, if i use this function (colorsys.rgb_to_hls(r, g, b)) and, for example, my data r = 0, g = 1, b = 2 or r = 0, g = 0, b = 2. I get an error.
My crutch in this problem:
if (r + g + b) == 2 or (r + g + b) == 3 or (r + g + b) == 4 and r == 2:
r = 3
print("crutch")
elif (r + g + b) == 2 or (r + g + b) == 3 or (r + g + b) == 4 and g == 2:
g = 3
print("crutch")
elif (r + g + b) == 2 or (r + g + b) == 3 or (r + g + b) == 4 and b == 2:
b = 3
print("crutch")
try:
hls_tmp = colorsys.rgb_to_hls(r, g, b)
except(ZeroDivisionError):
print(r, g, b)
exit(0)
google#398 opened by @Fedorov688 on Feb 27
Hi, if i use this function (colorsys.rgb_to_hls(r, g, b)) and, for example, my data r = 0, g = 1, b = 2 or r = 0, g = 0, b = 2. I get an error.
My crutch in this problem:
if (r + g + b) == 2 or (r + g + b) == 3 or (r + g + b) == 4 and r == 2:
r = 3
print("crutch")
elif (r + g + b) == 2 or (r + g + b) == 3 or (r + g + b) == 4 and g == 2:
g = 3
print("crutch")
elif (r + g + b) == 2 or (r + g + b) == 3 or (r + g + b) == 4 and b == 2:
b = 3
print("crutch")
try:
hls_tmp = colorsys.rgb_to_hls(r, g, b)
except(ZeroDivisionError):
print(r, g, b)
exit(0)
https://github.com/google/grumpy/blob/3ec87959189cfcdeae82eb68a47648ac25ceb10b/third_party/stdlib/colorsys.py#L81
The text was updated successfully, but these errors were encountered: