Skip to content

Commit 6c7ef3a

Browse files
committed
fix for rainbowcomet on regular python (Fixes #32)
1 parent ad00c4b commit 6c7ef3a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

adafruit_led_animation/animation/comet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __init__(
9494
def _recompute_color(self, color):
9595
pass
9696

97-
def __recompute_color(self, color):
97+
def _comet_recompute_color(self, color):
9898
self._comet_colors = [BLACK] + [
9999
[
100100
int(color[rgb] * ((n * self._color_step) + self._color_offset))
@@ -115,7 +115,7 @@ def _comet_generator(self):
115115
cycle_passes = 0
116116
while True:
117117
if self._color != self._computed_color or not self._comet_colors:
118-
self.__recompute_color(self._color)
118+
self._comet_recompute_color(self._color)
119119
colors = self._reverse_comet_colors if self.reverse else self._comet_colors
120120
for start in self._get_range(num_pixels):
121121

@@ -126,7 +126,7 @@ def _comet_generator(self):
126126
if start <= 0:
127127
num_visible = self._tail_length + start
128128
self.pixel_object[0:num_visible] = colors[
129-
self._tail_length - num_visible :
129+
self._tail_length - num_visible:
130130
]
131131
else:
132132
self.pixel_object[start : start + end] = colors[0:end]

adafruit_led_animation/animation/rainbowcomet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _calc_brightness(self, n, color):
8484
color = (color & 0xFF, ((color & 0xFF00) >> 8), (color >> 16))
8585
return [int(i * brightness) for i in color]
8686

87-
def __recompute_color(self, color):
87+
def _comet_recompute_color(self, color):
8888
factor = int(256 / self._tail_length)
8989
self._comet_colors = [BLACK] + [
9090
self._calc_brightness(

0 commit comments

Comments
 (0)