From bac273b46d31082f886351420664dbe48c9445e2 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 13 Dec 2024 11:52:07 -0600 Subject: [PATCH] rainbow commet fix for tail_length > 256 --- adafruit_led_animation/animation/rainbowcomet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_led_animation/animation/rainbowcomet.py b/adafruit_led_animation/animation/rainbowcomet.py index beae255..c22a71f 100644 --- a/adafruit_led_animation/animation/rainbowcomet.py +++ b/adafruit_led_animation/animation/rainbowcomet.py @@ -60,7 +60,7 @@ class RainbowComet(Comet): ring=False, ): if step == 0: - self._colorwheel_step = int(256 / tail_length) + self._colorwheel_step = max(int(256 / tail_length), 1) else: self._colorwheel_step = step self._colorwheel_offset = colorwheel_offset