diff --git a/examples/gizmo_eink_simpletest.py b/examples/gizmo_eink_simpletest.py index 3392c64..040e870 100644 --- a/examples/gizmo_eink_simpletest.py +++ b/examples/gizmo_eink_simpletest.py @@ -16,7 +16,13 @@ with open("/display-ruler.bmp", "rb") as file: picture = displayio.OnDiskBitmap(file) # Create a Tilegrid with the bitmap and put in the displayio group - sprite = displayio.TileGrid(picture, pixel_shader=displayio.ColorConverter()) + # CircuitPython 6 & 7 compatible + sprite = displayio.TileGrid( + picture, + pixel_shader=getattr(picture, "pixel_shader", displayio.ColorConverter()), + ) + # CircuitPython 7 compatible only + # sprite = displayio.TileGrid(picture, pixel_shader=bitmap.pixel_shader) display_group.append(sprite) # Place the display group on the screen diff --git a/examples/gizmo_tft_thermometer.py b/examples/gizmo_tft_thermometer.py index 7cc4fb5..bfccc2b 100644 --- a/examples/gizmo_tft_thermometer.py +++ b/examples/gizmo_tft_thermometer.py @@ -44,7 +44,13 @@ def c_to_f(c_val): bitmap = displayio.OnDiskBitmap(bitmap_file) # Create a TileGrid to hold the bitmap - tile_grid = displayio.TileGrid(bitmap, pixel_shader=displayio.ColorConverter()) + # CircuitPython 6 & 7 compatible + tile_grid = displayio.TileGrid( + bitmap, + pixel_shader=getattr(bitmap, "pixel_shader", displayio.ColorConverter()), + ) + # CircuitPython 7 compatible only + # tile_grid = displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader) # Create a Group to hold the TileGrid group = displayio.Group()