diff --git a/adafruit_ht16k33/matrix.py b/adafruit_ht16k33/matrix.py index d803d78..55a7152 100644 --- a/adafruit_ht16k33/matrix.py +++ b/adafruit_ht16k33/matrix.py @@ -139,9 +139,7 @@ def image(self, img: Image) -> None: imwidth, imheight = img.size if imwidth != self.columns or imheight != self.rows: raise ValueError( - "Image must be same dimensions as display ({0}x{1}).".format( - self.columns, self.rows - ) + f"Image must be same dimensions as display ({self.columns}x{self.rows})." ) # Grab all the pixels from the image, faster than getpixel. pixels = img.convert("1").load() @@ -259,8 +257,8 @@ def fill(self, color: int) -> None: fill1 = 0xFF if color & 0x01 else 0x00 fill2 = 0xFF if color & 0x02 else 0x00 for i in range(8): - self._set_buffer(i * 2, fill1) - self._set_buffer(i * 2 + 1, fill2) + self._set_buffer(i * 2 + 1, fill1) + self._set_buffer(i * 2, fill2) if self._auto_write: self.show() @@ -274,9 +272,7 @@ def image(self, img: Image) -> None: imwidth, imheight = img.size if imwidth != self.columns or imheight != self.rows: raise ValueError( - "Image must be same dimensions as display ({0}x{1}).".format( - self.columns, self.rows - ) + f"Image must be same dimensions as display ({self.columns}x{self.rows})." ) # Grab all the pixels from the image, faster than getpixel. pixels = img.convert("RGB").load()