Skip to content

fix for RainbowComet on regular python (Fixes #32) #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions adafruit_led_animation/animation/comet.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(
def _recompute_color(self, color):
pass

def __recompute_color(self, color):
def _comet_recompute_color(self, color):
self._comet_colors = [BLACK] + [
[
int(color[rgb] * ((n * self._color_step) + self._color_offset))
Expand All @@ -115,7 +115,7 @@ def _comet_generator(self):
cycle_passes = 0
while True:
if self._color != self._computed_color or not self._comet_colors:
self.__recompute_color(self._color)
self._comet_recompute_color(self._color)
colors = self._reverse_comet_colors if self.reverse else self._comet_colors
for start in self._get_range(num_pixels):

Expand Down
2 changes: 1 addition & 1 deletion adafruit_led_animation/animation/rainbowcomet.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def _calc_brightness(self, n, color):
color = (color & 0xFF, ((color & 0xFF00) >> 8), (color >> 16))
return [int(i * brightness) for i in color]

def __recompute_color(self, color):
def _comet_recompute_color(self, color):
factor = int(256 / self._tail_length)
self._comet_colors = [BLACK] + [
self._calc_brightness(
Expand Down