Merge pull request #120 from indomitableSwan/main

Fixes #76
This commit is contained in:
Dan Halbert 2024-08-21 16:52:46 -04:00 committed by GitHub
commit 8dda51a010
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,9 +85,9 @@ class Rainbow(Animation):
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)