コード例 #1
0
ファイル: maxdraw.py プロジェクト: elamperti/max7219
 def paintNoise(self, ratio):
     """Returns a canvas filled with random noise using ratio as threshold."""
     tmpCanvas = Canvas(self.width, self.height)
     for b in range(tmpCanvas.getSize()):
         tmpCanvas._c[b] = False if random.random() > ratio else True
     return tmpCanvas