diff --git a/adafruit_led_animation/animation/rainbow.py b/adafruit_led_animation/animation/rainbow.py index c5ad620..5c2b35b 100644 --- a/adafruit_led_animation/animation/rainbow.py +++ b/adafruit_led_animation/animation/rainbow.py @@ -85,9 +85,9 @@ def _color_wheel_generator(self): if pos < last_pos: cycle_completed = True last_pos = pos - wheel_index = int((pos / period) * len(self.colors)) if self.colors: + wheel_index = int((pos / period) * len(self.colors)) self._draw_precomputed(num_pixels, wheel_index) else: wheel_index = int((pos / period) * 256)