From b81284abcf6565638edd05873c9b99109511cbb3 Mon Sep 17 00:00:00 2001 From: Erik van Blokland Date: Wed, 13 Dec 2023 16:23:33 +0100 Subject: [PATCH] Add color to werkman demo --- Scripting examples/db_werkman.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Scripting examples/db_werkman.py b/Scripting examples/db_werkman.py index a5ebbd5..794ccaf 100644 --- a/Scripting examples/db_werkman.py +++ b/Scripting examples/db_werkman.py @@ -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)