back to the old decrement. It had a better effect

This commit is contained in:
tostadora 2014-02-05 19:24:36 +01:00
parent c13cb44cfe
commit a00b1c8c84
1 changed files with 3 additions and 4 deletions

View File

@ -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)