def animate(self): r, g, b = colorsys.hsv_to_rgb(self._step * 0.01, 1, 1) self._step += 1 if self._step >= 100: self._step = 0 self.clear(r, g, b, 1.0) return Layer(self._rgba)
def animate(self): self.clear(1, 1, 1, 0) if self._step < self._h: for x in range(self._w): self.setp(x, self._h - self._step - 1, 1, 0.56, 0, 1) self._step = self._step + 1 else: self._step = 0 return Layer(self._rgba)
def animate(self): self.clear(0, 0, 0, 0) for p in range(5): self.setp(randint(0, self._w - 1), randint( 0, self._h - 1, ), 1, 0, 1, 1) return Layer(self._rgba)
def animate(self): gap = 50 - self._speed + 1 if self._step <= gap: self.clear(0, 0, 0, 1) self._step = self._step + 1 else: self.clear(1, 1, 1, 1) self._step = 0 return Layer(self._rgba)
def _load_config(self): configfile = open(self._settings.WALL_CONFIG_FILE, 'r') data = simplejson.load(configfile) configfile.close() self._w = int(data['w']) self._h = int(data['h']) self._mapping = {} for k, v in data['mapping'].items(): self._mapping[int(k)] = int(v) ones = np.ones((self._h, self._w)) zeros = np.zeros((self._h, self._w)) self._bg = Layer([zeros, zeros.copy(), zeros.copy(), ones])
def __init__(self, w, h): self._w = int(w) self._h = int(h) self._speed = 25 self._blend_mode = BLEND_MODE_NORMAL self._hue = 0 self._colorize = False self._brighness = 0 self._contrast = 0 self._opacity = 100 self._step = 0 a = np.zeros((self._h, self._w)) self._rgba = [a, a.copy(), a.copy(), a.copy()] self._prevframe = Layer(self._rgba) self._last_time = 0
def animate(self): total = len(self._pixels1) alpha = 1 if self._step >= total * 2: self._step = 0 if self._step >= total: alpha = 0 pixel1 = self._pixels1[self._step % total] pixel2 = self._pixels2[self._step % total] self.setp(pixel1[0], pixel1[1], 0.35, 0.15, 0.9, alpha) self.setp(pixel2[0], pixel2[1], 0.17, 0.62, 1, alpha) self._step += 1 return Layer(self._rgba)
def animate(self): self.clear(1, 1, 1, 0) x = self._step if x >= self._w: x = self._w * 2 - x - 2 for y in range(self._h): self.setp(x, y, 0, 0.98, 1, 1) if x < self._w - 1: self.setp(x + 1, y, 0, 0.98, 1, 0.3) if x < self._w - 2: self.setp(x + 2, y, 0, 0.98, 1, 0.1) if x > 0: self.setp(x - 1, y, 0, 0.98, 1, 0.3) if x > 1: self.setp(x - 2, y, 0, 0.98, 1, 0.1) if self._step < self._w * 2 - 3: self._step = self._step + 1 else: self._step = 0 return Layer(self._rgba)