Merge pull request #33 from rhooper/fix-rainbow-comet-on-pi

fix for RainbowComet on regular python (Fixes #32)
This commit is contained in:
foamyguy 2020-05-28 17:44:35 -05:00 committed by GitHub
commit 37e9190178
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -94,7 +94,7 @@ class Comet(Animation):
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))
@ -115,7 +115,7 @@ class Comet(Animation):
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):

View file

@ -84,7 +84,7 @@ class RainbowComet(Comet):
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(