Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit a00b1c8

Browse files
committed
back to the old decrement. It had a better effect
1 parent c13cb44 commit a00b1c8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

effects/snake.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717

1818
# Initialize the led data
1919
snakeLeds = max(1, int(hyperion.ledCount*factor))
20-
decrement = hsv[2]/snakeLeds
2120
ledData = bytearray()
2221

2322
for i in range(hyperion.ledCount-snakeLeds):
2423
ledData += bytearray((0, 0, 0))
2524

26-
for i in range(snakeLeds):
27-
rgb = colorsys.hsv_to_rgb(hsv[0], hsv[1], hsv[2]-(i*decrement))
25+
for i in range(1,snakeLeds+1):
26+
rgb = colorsys.hsv_to_rgb(hsv[0], hsv[1], hsv[2]/i)
2827
ledData += bytearray((int(rgb[0]*255), int(rgb[1]*255), int(rgb[2]*255)))
2928

3029
# Calculate the sleep time and rotation increment
@@ -38,5 +37,5 @@
3837
# Start the write data loop
3938
while not hyperion.abort():
4039
hyperion.setColor(ledData)
41-
ledData = ledData[-increment:] + ledData[:-increment]
40+
ledData = ledData[increment:] + ledData[:increment]
4241
time.sleep(sleepTime)

0 commit comments

Comments
 (0)