Commit 6e90fa5e authored by datewat's avatar datewat
Browse files

rc3 Terminal-Effekt

parent c4603afb
#!/usr/bin/env python3
import matelight
import time
import random
#rc3_primary_colors = [
# ["#b239ff", "#670295", "#440069", "#240038"],
# ["#6800e7", "#41008b", "#2a005e", "#14002f"],
# ["#05b9ec", "#0076a9", "#025d84", "#002a3a"],
# ]
rc3_primary_colors = [
["#b239ff","#6800e7","#05b9ec","#100e23"],
["#fd294f","#160afe","#ffebd8","#01022a"],
["#FFF900","#02fae0","#0bcb60","#0e1c23"],
["#e500fc","#46eed5","#751de7","#160624"]
]
def hex2rgb(color):
color = color[1:]
return tuple(int(color[i:i+2], 16) for i in (0, 2, 4))
def rc3_Terminal(ml):
for y in range(ml.height):
for x in range(ml.width):
# i = random.randint(len(rc3_primary_colors))
# color = random.choice(rc3_primary_colors[i])
#color = random.choice(random.choice(rc3_primary_colors))
ml.set_pixel(x, y, *hex2rgb('#000000'))
color1 = '#ffffff'
ml.set_pixel(2,2,*hex2rgb(color1))
ml.set_pixel(2,3,*hex2rgb(color1))
ml.set_pixel(3,2,*hex2rgb(color1))
ml.set_pixel(3,3,*hex2rgb(color1))
ml.set_pixel(4,4,*hex2rgb(color1))
ml.set_pixel(4,5,*hex2rgb(color1))
ml.set_pixel(5,4,*hex2rgb(color1))
ml.set_pixel(5,5,*hex2rgb(color1))
ml.set_pixel(6,6,*hex2rgb(color1))
ml.set_pixel(6,7,*hex2rgb(color1))
ml.set_pixel(7,6,*hex2rgb(color1))
ml.set_pixel(7,7,*hex2rgb(color1))
ml.set_pixel(4,8,*hex2rgb(color1))
ml.set_pixel(4,9,*hex2rgb(color1))
ml.set_pixel(5,8,*hex2rgb(color1))
ml.set_pixel(5,9,*hex2rgb(color1))
ml.set_pixel(2,10,*hex2rgb(color1))
ml.set_pixel(2,11,*hex2rgb(color1))
ml.set_pixel(3,10,*hex2rgb(color1))
ml.set_pixel(3,11,*hex2rgb(color1))
ml.show()
color2 = '#000000'
u = 1
while u < 2:
ml.show()
time.sleep(0.4)
ml.set_pixel(8,10,*hex2rgb(color2))
ml.set_pixel(8,11,*hex2rgb(color2))
ml.set_pixel(9,10,*hex2rgb(color2))
ml.set_pixel(9,11,*hex2rgb(color2))
ml.set_pixel(10,10,*hex2rgb(color2))
ml.set_pixel(10,11,*hex2rgb(color2))
ml.set_pixel(11,10,*hex2rgb(color2))
ml.set_pixel(11,11,*hex2rgb(color2))
ml.show()
time.sleep(0.4)
ml.set_pixel(8,10,*hex2rgb(color1))
ml.set_pixel(8,11,*hex2rgb(color1))
ml.set_pixel(9,10,*hex2rgb(color1))
ml.set_pixel(9,11,*hex2rgb(color1))
ml.set_pixel(10,10,*hex2rgb(color1))
ml.set_pixel(10,11,*hex2rgb(color1))
ml.set_pixel(11,10,*hex2rgb(color1))
ml.set_pixel(11,11,*hex2rgb(color1))
wh=wh+1
time.sleep(1)
ml.show()
if __name__ == "__main__":
ml = matelight.Matelight(3, 4, serial="window/canvas")
ml.clear()
# while True:
if True:
effect = random.randint(1, 9)
effect = 0
# for effect in range(6):
if effect == 0:
rc3_Terminal(ml)
# ml.clear()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment