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
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) )