Skip to content

Commit

Permalink
Merge pull request #456 from madig/fix-converting-color-to-glyphs
Browse files Browse the repository at this point in the history
UFO2Glyphs: Ensure color tuples consist of integers
  • Loading branch information
madig authored Nov 7, 2018
2 parents 477f9b8 + 27f6c1e commit 297d251
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Lib/glyphsLib/builder/glyph.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import logging

from defcon import Color # noqa
from fontTools.misc.py23 import round

import glyphsLib.glyphdata
from .common import to_ufo_time, from_loose_ufo_time
Expand Down
6 changes: 4 additions & 2 deletions tests/builder/to_glyphs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@ def test_glyph_color():

font = to_glyphs([ufo])

assert font.glyphs["a"].color == 3
assert font.glyphs["b"].color == [4, 128, 0, 255]
rt_a_color = font.glyphs["a"].color
assert rt_a_color == 3 and type(rt_a_color) is int
rt_b_color = font.glyphs["b"].color
assert rt_b_color == [4, 128, 0, 255] and all(type(x) is int for x in rt_b_color)

ufo, = to_ufos(font)

Expand Down

0 comments on commit 297d251

Please sign in to comment.