示例#1
0
    def getPixelSequence(self):
        seq = []
        for row in self.matrix:
            for cell in row:
                seq.append((cell.getColor() % 4 * 64, cell.getColor() % 8 * 32, cell.getColor() % 16 * 16))

        return seq
示例#2
0
 def populateImage(self, image):
     for row in self.matrix:
         for cell in row:
             if not cell.getColor():
                 continue
             image.putpixel(
                 (cell.x, cell.y), (cell.getColor() % 4 * 64, cell.getColor() % 8 * 32, cell.getColor() % 16 * 16)
             )