cycle complete at start_color
This commit is contained in:
parent
da467ce9b7
commit
43aa654b4d
1 changed files with 2 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ class ColorCycle(Animation):
|
||||||
format. Defaults to a rainbow color cycle.
|
format. Defaults to a rainbow color cycle.
|
||||||
:param start_color: An index (from 0) for which color to start from. Default 0 (first color).
|
:param start_color: An index (from 0) for which color to start from. Default 0 (first color).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# pylint: disable=too-many-arguments
|
# pylint: disable=too-many-arguments
|
||||||
def __init__(self, pixel_object, speed, colors=RAINBOW, start_color=0, name=None):
|
def __init__(self, pixel_object, speed, colors=RAINBOW, start_color=0, name=None):
|
||||||
self.colors = colors
|
self.colors = colors
|
||||||
|
|
@ -61,7 +61,7 @@ class ColorCycle(Animation):
|
||||||
self._color = self.colors[index]
|
self._color = self.colors[index]
|
||||||
yield
|
yield
|
||||||
index = (index + 1) % len(self.colors)
|
index = (index + 1) % len(self.colors)
|
||||||
if index == 0:
|
if index == start_color:
|
||||||
self.cycle_complete = True
|
self.cycle_complete = True
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue