Skip to content

Commit be18d57

Browse files
committed
fix rainbowchase on large strips (eg 512)
1 parent d408102 commit be18d57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_led_animation/animation/rainbowchase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(
7878
super().__init__(pixel_object, speed, 0, size, spacing, reverse, name)
7979

8080
def bar_color(self, n, pixel_no=0):
81-
return self._colors[self._color_idx - n]
81+
return self._colors[self._color_idx - (n % len(self._colors))]
8282

8383
def on_cycle_complete(self):
8484
self._color_idx = (self._color_idx + self._direction) % len(self._colors)

0 commit comments

Comments
 (0)