dont crash on alpha channel
This commit is contained in:
parent
7e7357ac49
commit
c9ca26a975
1 changed files with 4 additions and 1 deletions
5
color.py
5
color.py
|
@ -117,7 +117,10 @@ COLORS = colors
|
||||||
|
|
||||||
|
|
||||||
def closestColor(rgb):
|
def closestColor(rgb):
|
||||||
r, g, b = rgb
|
try:
|
||||||
|
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