Skip to content

Commit dc14949

Browse files
committed
fix: correct how named colors are looked up
1 parent 9178939 commit dc14949

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

glooey/drawing/color.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ def from_anything(color):
3232
def from_str(str):
3333
# If the given string is to the name of a known color, return that
3434
# color. Otherwise, treat the string as a hex code.
35-
if str in glooey.drawing.colors:
36-
return glooey.drawing.colors[str]
37-
else:
35+
try:
36+
return colors[str]
37+
except KeyError:
3838
return Color.from_hex(str)
3939

4040
@staticmethod

0 commit comments

Comments
 (0)