File tree 1 file changed +3
-1
lines changed
adafruit_led_animation/animation
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ def __init__(
51
51
pixel_object ,
52
52
speed ,
53
53
color ,
54
+ background_color = BLACK ,
54
55
tail_length = 0 ,
55
56
reverse = False ,
56
57
bounce = False ,
@@ -68,6 +69,7 @@ def __init__(
68
69
self ._color_step = 0.95 / tail_length
69
70
self ._comet_colors = None
70
71
self ._computed_color = color
72
+ self ._background_color = background_color
71
73
self ._num_pixels = len (pixel_object )
72
74
self ._direction = - 1 if reverse else 1
73
75
self ._left_side = - self ._tail_length
@@ -82,7 +84,7 @@ def __init__(
82
84
on_cycle_complete_supported = True
83
85
84
86
def _set_color (self , color ):
85
- self ._comet_colors = [BLACK ]
87
+ self ._comet_colors = [self . _background_color ]
86
88
for n in range (self ._tail_length ):
87
89
self ._comet_colors .append (
88
90
calculate_intensity (color , n * self ._color_step + 0.05 )
You can’t perform that action at this time.
0 commit comments