HOME | DD

Published: 2022-04-15 08:07:15 +0000 UTC; Views: 67; Favourites: 1; Downloads: 1
Redirect to original
Description
This is precisely what I was after: a raster with wobbly eyes. Not sure what the added value is, but hey. It wroks. Now I need to make it grab colors from a palette. Probably on the morrow.Coda (changes are minimal: two uniform() calls):
# Raster with wobbly eyes
l1 = layer('Squares')
l2 = layer('Circles')
l3 = layer('raster')
for y in range(0, int(height), 100):
for x in range(0, int(width), 100):
r1 = rect((x, y), (x + 100, y + 100), stroke_width=0, fill='#%02x%02x%02x' % (randrange(256), randrange(256), randrange(256)))
l1.add(r1)
c1 = circle((x + 50 + uniform(-2.5, 2.5), y + 50 + uniform(-2.5, 2.5)), 25, stroke_width=0, fill='#%02x%02x%02x' % (randrange(256), randrange(256), randrange(256)))
l2.add(c1)
r2 = rect((x, y), (x + 100, y + 100), stroke_width=0, fill='#0062afx ').to_path()
c2 = circle((x + 50, y + 50), 30).to_path()
r2.append(c2)
l3.add(r2)