allow args. README.
This commit is contained in:
parent
529262ea4d
commit
f10caa3918
7 changed files with 71 additions and 16 deletions
31
scenes/color.py
Normal file
31
scenes/color.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import io
|
||||
from time import sleep
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
import lib.display
|
||||
|
||||
import datetime
|
||||
import locale
|
||||
locale.setlocale(locale.LC_TIME, "de_DE.UTF-8")
|
||||
|
||||
def start(stop_event, args):
|
||||
image_buffer = lib.display.matrix.buffer()
|
||||
draw = ImageDraw.Draw(image_buffer)
|
||||
|
||||
#print(int(args.get('red', 0)))
|
||||
|
||||
# All to color
|
||||
draw.rectangle(
|
||||
( (0,0), (lib.display.matrix.width-1,lib.display.matrix.height-1) ),
|
||||
fill=(
|
||||
int(args.get('red', 0)),
|
||||
int(args.get('green', 0)),
|
||||
int(args.get('blue', 0))
|
||||
)
|
||||
)
|
||||
lib.display.matrix.show(image_buffer)
|
||||
|
||||
while not stop_event.is_set():
|
||||
sleep(0.5)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue