File tree 2 files changed +5
-2
lines changed
adafruit_led_animation/animation
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -185,15 +185,15 @@ def color(self):
185
185
def color (self , color ):
186
186
if self ._color == color :
187
187
return
188
+ if isinstance (color , int ):
189
+ color = (color >> 16 & 0xFF , color >> 8 & 0xFF , color & 0xFF )
188
190
self ._set_color (color )
189
191
190
192
def _set_color (self , color ):
191
193
"""
192
194
Called after the color is changed, which includes at initialization.
193
195
Override as needed.
194
196
"""
195
- if isinstance (color , int ):
196
- color = (color >> 16 & 0xFF , color >> 8 & 0xFF , color & 0xFF )
197
197
self ._color = color
198
198
199
199
@property
Original file line number Diff line number Diff line change @@ -80,6 +80,9 @@ def __init__(
80
80
)
81
81
self ._generator = pulse_generator (self ._period , self , dotstar_pwm = dotstar )
82
82
83
+ def _set_color (self , color ):
84
+ self ._color = color
85
+
83
86
def draw (self ):
84
87
self ._sparkle_color = next (self ._generator )
85
88
super ().draw ()
You can’t perform that action at this time.
0 commit comments