From 3d91a7862148bf9dde12d00db6aa518536a02702 Mon Sep 17 00:00:00 2001 From: indomitableSwan <5496520+indomitableSwan@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:14:52 -0400 Subject: [PATCH] Move misplaced computation of `wheel_index` into the case for `precompute_rainbow=True` --- adafruit_led_animation/animation/rainbow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)