コード例 #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))
コード例 #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))
コード例 #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])
コード例 #4
0
 def b(self):
     return _get(self.a, self.i+2)
コード例 #5
0
 def g(self):
     return _get(self.a, self.i)
コード例 #6
0
 def r(self):
     return _get(self.a, self.i+1)
コード例 #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])
コード例 #8
0
 def b(self):
     return _get(self.a, self.i + 2)
コード例 #9
0
 def g(self):
     return _get(self.a, self.i)
コード例 #10
0
 def r(self):
     return _get(self.a, self.i + 1)