Skip to content

Commit

Permalink
Add color to werkman demo
Browse files Browse the repository at this point in the history
  • Loading branch information
LettError committed Dec 13, 2023
1 parent 72bb100 commit b81284a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Scripting examples/db_werkman.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@
blendMode("multiply")
names = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "arrowdown", "arrowleft", "arrowright", "arrowup"]

clr = [(1,0,0), (0,0,1)]
clr = [(1,0,0), (0,0,1), (1,.9,0)]

with savedState():
translate(0, 100)
for i, x in enumerate((.33*width(), .66*width())):
for c in clr:
with savedState():
translate(x, 0)
translate(.5 * width(), 0)
scale(0.5)
fill(*clr[i])

# ask the designspace for a good random location
fill(*c)
loc = d.randomLocation()
glyphName = choice(names)

# make one glyph
g = d.makeOneGlyph(glyphName, decomposeComponents=True, location=loc)
if g is not None:
translate(-.5*g.width,0)
Expand Down

0 comments on commit b81284a

Please sign in to comment.