def step(self, amt=1):
        self._led.fillScreen(self.bgcolor)  # background color
        # check if we may add a new circle to the list
        if not random.randrange(
                self.prob_circ) and len(self.cont) <= self.max_circ:
            self.addCircle()

        # loop through our circles, draw and update them
        for circ in self.cont:
            self._led.drawCircle(circ._x, circ._y, circ._radius,
                                 colors.hue2rgb_360(circ._color))

            if not self._step % circ.frameratio:
                circ.grow()
                circ.changeColor()

        self._step += amt
        # don't let our step counter grow endlessly
        if self._step >= 100:
            self._step %= 100

        # remove circles that have grown bigger than our matrix
        self.cont = [
            c for c in self.cont
            if c._radius != max(self._led.height, self._led.width) + 1
        ]
Exemplo n.º 2
0
 def step(self, amt=1):
     self.layout.all_off()
     for y in range(self.height):
         for x in range(self.width):
             h = self.call_func(self.cur_func, x, y, self._step)
             if self.next_func:
                 h_next = self.call_func(self.next_func, x, y, self._step)
                 h = hue_fade(h, h_next, self.fade_step * self.fade_count)
             c = colors.hue2rgb_360(h)
             self.layout.set(x, y, c)
     if self.next_func:
         self.fade_count += 1
         if self.fade_count >= self.fade_frames:
             self.cur_func = self.next_func
             self.next_func = None
             self.fade_count = 0
             self.count = 0
     else:
         self.count += 1
     if not self.next_func and self.frames_per and self.count >= self.frames_per:
         if self.rand:
             self.next_func = random.choice(range(len(self.funcs)))
         else:
             self.next_func = self.cur_func + 1
             if self.next_func >= len(self.funcs):
                 self.next_func = 0
         self.count = 0
         if not self.fade_frames:
             self.cur_func = self.next_func
             self.next_func = None
     self._step += amt
Exemplo n.º 3
0
 def step(self, amt=1):
     self.layout.all_off()
     c = colors.hue2rgb_360(self._step)
     self.layout.fillRing(0, c, startAngle=0, endAngle=self._step)
     # for r, c in enumerate(self.colors):
     #     self.layout.fillRing(r, c, startAngle=0, endAngle=self._step)
     self._step += amt
     self._step %= 360
Exemplo n.º 4
0
	def step(self,amt=1):
		self._led.fill(colors.hue2rgb_360(self._step))
		self._led.update()

		self._step += amt

		if self._step > 255:
			self._step = 0
    def step(self, amt=1):
        self._led.all_off()
        a = pointOnCircle(self._cx, self._cy, self._radius, self._angles[0])
        b = pointOnCircle(self._cx, self._cy, self._radius, self._angles[1])
        c = pointOnCircle(self._cx, self._cy, self._radius, self._angles[2])

        color = colors.hue2rgb_360(self._angles[0])

        self._led.drawLine(a[0], a[1], b[0], b[1], color, aa=self.aa)
        self._led.drawLine(b[0], b[1], c[0], c[1], color, aa=self.aa)
        self._led.drawLine(c[0], c[1], a[0], a[1], color, aa=self.aa)

        self._angles = self.__stepAngles(self._angles, amt)
    def step(self, amt = 1):
        self._led.all_off()
        a = pointOnCircle(self._cx, self._cy, self._radius, self._angles[0])
        b = pointOnCircle(self._cx, self._cy, self._radius, self._angles[1])
        c = pointOnCircle(self._cx, self._cy, self._radius, self._angles[2])

        color = colors.hue2rgb_360(self._angles[0])

        self._led.drawLine(a[0], a[1], b[0], b[1], color)
        self._led.drawLine(b[0], b[1], c[0], c[1], color)
        self._led.drawLine(c[0], c[1], a[0], a[1], color)

        self._angles = self.__stepAngles(self._angles, amt)
Exemplo n.º 7
0
    def get_color(self):
        color_seed = MidiTransform.remap_cc_value(self.color_control, 0, 10)
        amount_change = MidiTransform.remap_cc_value(self.utility_control_one,
                                                     0.1, 5)
        if amount_change == 5:
            amount_change = 0

        base_color = (self._color_number + color_seed) % 359
        self._color_number = (base_color + amount_change) % 359

        color = bp_colors.hue2rgb_360(self._color_number)
        c_lev = MidiTransform.remap_cc_value(self.brightness_control, 0, 256)

        self._color = bp_colors.color_scale(color, c_lev)
Exemplo n.º 8
0
    def step(self, amt = 1):
        for y in range(h):
			for x in range(w):
				c = colors.hue2rgb_360(self._step)
				led.set(x, y, c)
				c = led.get(x, y)
				c = colors.hsv2rgb_rainbow((c[2], c[0], c[1]))
				c = colors.hue2rgb_rainbow(c[0])
				c = colors.hue2rgb_spectrum(c[1])
				c = colors.hue2rgb_raw(c[2])
				c = colors.color_scale(c, c[0])
				c = colors.color_scale(c, c[1])
				c = colors.color_scale(c, c[2])
				led.set(x, y, c)

        self._step += 1
        if self._step >= 360:
        	self._step = 0
    def step(self, amt=1):
        self._led.fillScreen(self.bgcolor)  # background color
        # check if we may add a new circle to the list
        if not random.randrange(self.prob_circ) and len(self.cont) <= self.max_circ:
            self.addCircle()

        # loop through our circles, draw and update them
        for circ in self.cont:
            self._led.drawCircle(circ._x, circ._y, circ._radius,
                                 colors.hue2rgb_360(circ._color))

            if not self._step % circ.frameratio:
                circ.grow()
                circ.changeColor()

        self._step += amt
        # don't let our step counter grow endlessly
        if self._step >= 100:
            self._step %= 100

        # remove circles that have grown bigger than our matrix
        self.cont = [c for c in self.cont if c._radius !=
                     max(self._led.height, self._led.width) + 1]