dont crash on alpha channel
This commit is contained in:
parent
7e7357ac49
commit
c9ca26a975
1 changed files with 4 additions and 1 deletions
3
color.py
3
color.py
|
@ -117,7 +117,10 @@ COLORS = colors
|
||||||
|
|
||||||
|
|
||||||
def closestColor(rgb):
|
def closestColor(rgb):
|
||||||
|
try:
|
||||||
r, g, b = rgb
|
r, g, b = rgb
|
||||||
|
except ValueError:
|
||||||
|
r, g, b, a = rgb
|
||||||
diss = {}
|
diss = {}
|
||||||
for cc in COLORS:
|
for cc in COLORS:
|
||||||
rc, gc, bc = COLORS[cc]
|
rc, gc, bc = COLORS[cc]
|
||||||
|
|
Loading…
Reference in a new issue