File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 4
4
from colorsys import hsv_to_rgb
5
5
6
6
speed = 40.0
7
-
7
+ light_count = 48
8
8
if __name__ == "__main__" :
9
9
import time
10
10
out = FadeAnimation ()
11
- out .FADERATE = 1.0 # seconds
11
+ out .FADERATE = 1.0 # seconds
12
12
out .start ()
13
13
14
14
counter = 0.0
15
15
16
16
while True :
17
- pix = [(0.0 ,0.0 ,0.0 )]* 24
17
+ pix = [(0.0 , 0.0 , 0.0 )] * light_count
18
18
for i in range (4 ):
19
19
for j in range (4 ):
20
- rgb = hsv_to_rgb ((sin (radians (counter )/ 2.0 + float (i )/ 6.0 )+ 1.0 )/ 2.0 , 1.0 , 1.0 )
21
- pix [i * 4 + j ] = (rgb [0 ]* 1023.0 , rgb [1 ]* 1023.0 , rgb [2 ]* 1023.0 )
20
+ rgb = hsv_to_rgb (
21
+ (sin (radians (counter ) / 2.0 + float (i ) / 6.0 ) + 1.0 ) / 2.0 , 1.0 , 1.0 )
22
+ pix [i * 4 + j ] = (
23
+ rgb [0 ] * 1023.0 , rgb [1 ] * 1023.0 , rgb [2 ] * 1023.0 )
22
24
out .write (pix )
23
- time .sleep (1.0 / speed )
25
+ time .sleep (1.0 / speed )
24
26
counter += 0.8
You can’t perform that action at this time.
0 commit comments