mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
back to the old decrement. It had a better effect
Former-commit-id: a00b1c8c84c7846f760e7c0cec7d08949bd6e6b7
This commit is contained in:
parent
e6ebd6696b
commit
b781c4403a
@ -17,14 +17,13 @@ hsv = colorsys.rgb_to_hsv(color[0]/255.0, color[1]/255.0, color[2]/255.0)
|
||||
|
||||
# Initialize the led data
|
||||
snakeLeds = max(1, int(hyperion.ledCount*factor))
|
||||
decrement = hsv[2]/snakeLeds
|
||||
ledData = bytearray()
|
||||
|
||||
for i in range(hyperion.ledCount-snakeLeds):
|
||||
ledData += bytearray((0, 0, 0))
|
||||
|
||||
for i in range(snakeLeds):
|
||||
rgb = colorsys.hsv_to_rgb(hsv[0], hsv[1], hsv[2]-(i*decrement))
|
||||
for i in range(1,snakeLeds+1):
|
||||
rgb = colorsys.hsv_to_rgb(hsv[0], hsv[1], hsv[2]/i)
|
||||
ledData += bytearray((int(rgb[0]*255), int(rgb[1]*255), int(rgb[2]*255)))
|
||||
|
||||
# Calculate the sleep time and rotation increment
|
||||
@ -38,5 +37,5 @@ increment %= hyperion.ledCount
|
||||
# Start the write data loop
|
||||
while not hyperion.abort():
|
||||
hyperion.setColor(ledData)
|
||||
ledData = ledData[-increment:] + ledData[:-increment]
|
||||
ledData = ledData[increment:] + ledData[:increment]
|
||||
time.sleep(sleepTime)
|
||||
|
Loading…
Reference in New Issue
Block a user