def __call__(self, leds): num = len(leds) while True: for _ in range(self.multiple * num): leds.right(fill=randomColor()) yield self.pause for _ in range(self.multiple * num): leds.left(fill=randomColor()) yield self.pause
def __call__(self, leds): num = len(leds) - 1 color = randomColor() leds[0] = color yield self.pause while True: for _ in range(num): leds.right() yield self.pause for _ in range(num): leds.left() yield self.pause leds[0] = randomColor()
def fadeOut(leds, interval=5.0, pause=0.1): fade = Fade(interval, pause) while True: color = randomColor() leds.fill(color) yield yield from fade(leds)
def __call__(self, leds): num = len(leds) while True: color = randomColor() for ii in range(0, 2 * (num // 2), 2): for cc in (color, BLACK, color): leds[ii] = cc leds[ii + 2] = cc yield self.pause color = randomColor() for ii in range(1, 2 * (num // 2 - 1), 2): for cc in (color, BLACK, color): leds[ii] = cc leds[ii + 2] = cc yield self.pause yield from self.fader(leds)
def left(self, leds): num = len(leds) color = randomColor() end = 0 for end in range(num): leds[num - 1] = color yield self.pause for _ in range(num - end - 1): leds.left() if end > 0: leds[end - 1] = color yield self.pause yield from self.fader(leds)
def right(self, leds): num = len(leds) color = randomColor() end = num for end in reversed(range(num)): leds[0] = color yield self.pause for _ in range(end): leds.right() if end + 1 < num: leds[end + 1] = color yield self.pause yield from self.fader(leds)
def __call__(self, leds): color = randomColor() leftEye = int(rng() / 255 * (len(leds) - self.distance)) rightEye = leftEye + self.distance leds[leftEye] = color leds[rightEye] = color yield self.pause * self.blink leds[leftEye] = BLACK leds[rightEye] = BLACK yield self.pause * self.blink leds[leftEye] = color leds[rightEye] = color yield self.pause * self.blink yield from self.fader(leds)
def __init__(self, p1, p2, p3): Triangle.__init__(self, p1, p2, p3) self.p1c = color.randomColor() self.p2c = color.randomColor() self.p3c = color.randomColor()