Skip to content

Commit 7014e28

Browse files
authored
Merge pull request #1365 from dglaude/patch-12
Give "colors" to the balls on MagTag_Christmas
2 parents 84bf824 + 069b0d1 commit 7014e28

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

MagTag_Christmas_Countdown/code.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,15 @@
6060

6161
# circles to cover-up bitmap's number ornaments
6262

63+
ball_color = [0x555555, 0xaaaaaa, 0xFFFFFF] # All colors except black (0x000000)
64+
ball_index = 0
65+
6366
# creating the circles & pulling in positions from spots
6467
for spot in spots:
65-
circle = Circle(x0=spot[0], y0=spot[1],
66-
r=11,
67-
fill=0xFF00FF)
68+
circle = Circle(x0=spot[0], y0=spot[1], r=11, fill=ball_color[ball_index]) # Each ball has a color
69+
ball_index += 1
70+
ball_index %= len(ball_color)
71+
6872
# adding circles to their display group
6973
circle_group.append(circle)
7074

0 commit comments

Comments
 (0)