-
Notifications
You must be signed in to change notification settings - Fork 0
/
tenPrint_colors.py
44 lines (31 loc) · 996 Bytes
/
tenPrint_colors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
PAGESIZE = 600
SQUARE = 20
FRAMES = 20
def drawSlash(x, y):
if random() > 0.5:
for i in range(3):
if i == 0:
fill(255/255, 224/255, 65/255, 1)
elif i == 1:
fill(36/255, 101/255, 168/255, 1)
else:
fill(238/255, 110/255, 147/255, 1)
rect(x, y + SQUARE * i / 3, SQUARE, SQUARE / 3)
else:
for i in range(3):
if i == 0:
fill(79/255, 197/255, 150/255, 1)
elif i == 1:
fill(58/255, 102/255, 179/255, 1)
else:
fill(249/255, 115/255, 45/255, 1)
rect(x + SQUARE * i / 3, y, SQUARE / 3, SQUARE)
for frame in range(FRAMES):
newPage(PAGESIZE, PAGESIZE)
frameDuration(1/5)
fill(0)
rect(0, 0, PAGESIZE, PAGESIZE)
for y in range(0, PAGESIZE, SQUARE):
for x in range(0, PAGESIZE, SQUARE):
drawSlash(x, y)
saveImage("_gifs/tenPrint_colors2.gif")