forked from andreeuuetoa/litsimaja
Some possibility to break the loop
This commit is contained in:
@@ -26,6 +26,8 @@ class Gaynbow(Program):
|
|||||||
while self.get_loop().status():
|
while self.get_loop().status():
|
||||||
"""Draw rainbow that uniformly distributes itself across all pixels."""
|
"""Draw rainbow that uniformly distributes itself across all pixels."""
|
||||||
for j in range(256 * iterations):
|
for j in range(256 * iterations):
|
||||||
|
if not self.get_loop().status():
|
||||||
|
break
|
||||||
for i in range(self._lm.count_pixels()):
|
for i in range(self._lm.count_pixels()):
|
||||||
self._lm.set_pixel_color(i, wheel(
|
self._lm.set_pixel_color(i, wheel(
|
||||||
(int(i * 256 / self._lm.count_pixels()) + j) & 255))
|
(int(i * 256 / self._lm.count_pixels()) + j) & 255))
|
||||||
|
|||||||
Reference in New Issue
Block a user