Beispiel #1
0
 def get_led_values(self, index, rgb=None):
     # The asm function is unguarded as to index, so enforce here
     if index >= self.led_count or index < -self.led_count:
         raise IndexError("tried to get values at", index)
     ix = index * 3
     return self.ReadOnlyPixel(_get(self.buf, ix+1), \
                               _get(self.buf, ix+0), \
                               _get(self.buf, ix+2))
Beispiel #2
0
 def get_led_values(self, index, rgb=None):
     # The asm function is unguarded as to index, so enforce here
     if index >= self.led_count or index < -self.led_count:
         raise IndexError("tried to get values at", index)
     ix = index * 3
     return self.ReadOnlyPixel(_get(self.buf, ix+1), \
                               _get(self.buf, ix+0), \
                               _get(self.buf, ix+2))
Beispiel #3
0
 def __getitem__(self, i):
     if i >= 3 or i < 0:
         raise IndexError("only 3 colors")
     return _get(self.a, self.i + self.cmap[i])
Beispiel #4
0
 def b(self):
     return _get(self.a, self.i+2)
Beispiel #5
0
 def g(self):
     return _get(self.a, self.i)
Beispiel #6
0
 def r(self):
     return _get(self.a, self.i+1)
Beispiel #7
0
 def __getitem__(self, i):
     if i >= 3 or i < 0:
         raise IndexError("only 3 colors")
     return _get(self.a, self.i + self.cmap[i])
Beispiel #8
0
 def b(self):
     return _get(self.a, self.i + 2)
Beispiel #9
0
 def g(self):
     return _get(self.a, self.i)
Beispiel #10
0
 def r(self):
     return _get(self.a, self.i + 1)