From: Melissa LeBlanc-Williams Date: Wed, 27 Sep 2023 19:31:36 +0000 (-0700) Subject: Bug fixes for SSD1306 X-Git-Tag: 1.0.0^2~10 X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/commitdiff_plain/7c8fcb8b324e839a65d45174da42bf9a7ab1a217 Bug fixes for SSD1306 --- diff --git a/displayio/_display.py b/displayio/_display.py index 022103d..3f6d7b6 100644 --- a/displayio/_display.py +++ b/displayio/_display.py @@ -460,7 +460,7 @@ class Display: self._core.send( DISPLAY_COMMAND, CHIP_SELECT_TOGGLE_EVERY_BYTE, - bytes([self._brightness_command, 0xFF * value]), + bytes([self._brightness_command, round(0xFF * value)]), ) else: self._core.send( diff --git a/displayio/_palette.py b/displayio/_palette.py index a017254..81f3bee 100644 --- a/displayio/_palette.py +++ b/displayio/_palette.py @@ -98,24 +98,6 @@ class Palette: self._colors[palette_index].transparent = False self._needs_refresh = True - """ - def _get_palette(self): - # Generate a palette for use with PIL - palette = [] - for color in self._colors: - palette += color.rgba()[0:3] - return palette - - def _get_alpha_palette(self): - # Generate an alpha channel palette with white being - # opaque and black being transparent - palette = [] - for color in self._colors: - for _ in range(3): - palette += [0 if color.transparent else 0xFF] - return palette - """ - def _get_color( self, colorspace: Colorspace, diff --git a/displayio/_tilegrid.py b/displayio/_tilegrid.py index dc392b9..5abfad4 100644 --- a/displayio/_tilegrid.py +++ b/displayio/_tilegrid.py @@ -392,7 +392,7 @@ class TileGrid: # even if we multiply it back out offset = ( col * pixels_per_byte - + (row // pixels_per_byte) * width + + (row // pixels_per_byte) * pixels_per_byte * width + (row % pixels_per_byte) ) shift = (offset % pixels_per_byte) * colorspace.depth