Exemplo n.º 1
0
    def refresh(self, matrix):
        try:
            pos = self.random.next()
        except:
            self.random = compoundLfsr(matrix.numpix)
            pos = self.random.next()

        # gently transition through all hues over HUEINCYCLES fills
        self.hue += 1.0/(matrix.numpix*HUEINCYCLES)
        color = hsvToRgb(self.hue, 1, 0.2+0.8*random())
        matrix.setStripPixel(pos, color)
Exemplo n.º 2
0
    def refresh(self, matrix):
        try:
            pos = self.random.next()
        except:
            self.random = compoundLfsr(matrix.numpix)
            pos = self.random.next()

        # gently transition through all hues over HUEINCYCLES fills
        self.hue += 1.0 / (matrix.numpix * HUEINCYCLES)
        color = hsvToRgb(self.hue, 1, 0.2 + 0.8 * random())
        matrix.setStripPixel(pos, color)
Exemplo n.º 3
0
 def start(self, matrix):
     # we could probably shuffle() up a range, but that sounds like
     # it'd be less of a challenge :)
     self.random = compoundLfsr(matrix.numpix)
     self.hue = random()
     matrix.clear()
Exemplo n.º 4
0
 def start(self, matrix):
     # we could probably shuffle() up a range, but that sounds like
     # it'd be less of a challenge :)
     self.random = compoundLfsr(matrix.numpix)
     self.hue = random()
     matrix.clear()