Adafruit_CircuitPython_LED_Animation icon indicating copy to clipboard operation
Adafruit_CircuitPython_LED_Animation copied to clipboard

precompute_rainbow=False causes an error in rainbow.py

Open mfinkle opened this issue 3 years ago • 0 comments

Rainbow initializes self.colors = None

_color_wheel_generator then tries to get the length

When using precompute_rainbow=False this will cause an error: TypeError: object of type 'NoneType' has no len()

Initializing self.colors = [] should still work in the truthy test or moving the wheel_index calculation into the if self.colors block could fix it too.

mfinkle avatar Apr 28 '21 03:04 mfinkle