Skip to content

Commit

Permalink
fix: correct how named colors are looked up
Browse files Browse the repository at this point in the history
  • Loading branch information
kalekundert committed Feb 27, 2021
1 parent 9178939 commit dc14949
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions glooey/drawing/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def from_anything(color):
def from_str(str):
# If the given string is to the name of a known color, return that
# color. Otherwise, treat the string as a hex code.
if str in glooey.drawing.colors:
return glooey.drawing.colors[str]
else:
try:
return colors[str]
except KeyError:
return Color.from_hex(str)

@staticmethod
Expand Down

0 comments on commit dc14949

Please sign in to comment.