mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
modify effects
- snake has a nice tail - random is not so fast anymore - merge sparks and sparks-color - make more params available in json files Former-commit-id: fc2a4f6f6ce2b44a35a75a9c0dbe36504b790be9
This commit is contained in:
@@ -1,24 +1,20 @@
|
||||
import hyperion
|
||||
import time
|
||||
import colorsys
|
||||
import random
|
||||
import hyperion, time, colorsys, random
|
||||
|
||||
# get args
|
||||
sleepTime = float(hyperion.args.get('speed', 1.0))
|
||||
saturation = float(hyperion.args.get('saturation', 1.0))
|
||||
ledData = bytearray()
|
||||
|
||||
# Initialize the led data
|
||||
ledData = bytearray()
|
||||
for i in range(hyperion.ledCount):
|
||||
ledData += bytearray((0,0,0))
|
||||
|
||||
sleepTime = 0.001
|
||||
|
||||
# Start the write data loop
|
||||
while not hyperion.abort():
|
||||
hyperion.setColor(ledData)
|
||||
for i in range(hyperion.ledCount):
|
||||
if random.randrange(10) == 1:
|
||||
hue = random.random()
|
||||
sat = 1.0
|
||||
val = random.random()
|
||||
rgb = colorsys.hsv_to_rgb(hue, sat, val)
|
||||
rgb = colorsys.hsv_to_rgb(random.random(), saturation, random.random())
|
||||
ledData[i*3 ] = int(255*rgb[0])
|
||||
ledData[i*3+1] = int(255*rgb[1])
|
||||
ledData[i*3+2] = int(255*rgb[2])
|
||||
|
Reference in New Issue
Block a user