-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheffects.py
38 lines (34 loc) · 1.01 KB
/
effects.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
from Led import Led
from random import randint
def ef1(led:Led, delay):
clr = [randint(0,255),randint(0,255),randint(0,255)]
while True:
clr[randint(0,2)] = randint(0,255)
for i in range(len(led)+1):
tmp = [c/len(led)*(i+5) for c in clr]
led[i] = led[len(led)-i] = tmp
led.show(delay)
yield
def ef2(led: Led, delay):
led.array[:,:,:] = 0
while True:
pix = randint(0, len(led))
led.random_clr(pix)
led.clearing(10)
led.show(delay)
yield
def ef3(led: Led, delay):
led.array[:,:,:] = 0
while True:
val = [randint(0,255),randint(0,255),randint(0,255)]
for i in range(len(led)):
led[i] = val
led.clearing(10)
led.show(delay)
yield
val = [randint(0,255),randint(0,255),randint(0,255)]
for i in reversed(range(len(led))):
led[i] = val
led.clearing(10)
led.show(delay)
yield