Some possibility to break the loop

feature/absolute-paths
siinus 4 years ago
parent 1b3b23bc99
commit 57559ea70a
  1. 2
      pyleds/program/siinus/Gaynbow.py

@ -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))

Loading…
Cancel
Save