Skip to content

Commit 704c188

Browse files
committed
Simplify the check of the guideline color.
1 parent 5249639 commit 704c188

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Lib/fontParts/base/glyph.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,17 +1703,11 @@ def _fromMathGlyph(self, mathGlyph, toThisGlyph=False, filterRedundantPoints=Tru
17031703
a._setIdentifier(identifier)
17041704
for guideline in mathGlyph.guidelines:
17051705
guideColor = guideline.get("color")
1706-
if type(guideColor) == tuple or guideColor is None:
1707-
colorData = guideColor
1706+
if guideColor is None:
1707+
colorData = None
17081708
else:
1709-
try:
1710-
colorData = (guideColor.r, guideColor.g, guideColor.b, guideColor.a)
1711-
except:
1712-
# it is not a tuple
1713-
# it is not a defcon color object
1714-
# it is just a color value for a guideline
1715-
# we can ignore it.
1716-
colorData = None
1709+
r, g, b, a = guideColor
1710+
colorData = (r, g, b, a)
17171711
g = copied.appendGuideline(
17181712
position=(guideline["x"], guideline["y"]),
17191713
angle=guideline["angle"],

0 commit comments

Comments
 (0)