Skip to content

displayio.Bitmap wrapping after certain displayio.Palette size #1744

@caternuson

Description

@caternuson

Tested on a PyPortal with:

Adafruit CircuitPython 4.0.0-beta.6 on 2019-03-30; Adafruit PyPortal with samd51j20

Test code:

import board
import displayio

COLORS = 16

palette = displayio.Palette(COLORS)
palette[0] = 0x000000
palette[1] = 0xFFFFFF

bitmap = displayio.Bitmap(320, 240, COLORS)
bitmap[(100, 100)] = 1
bitmap[(100, 101)] = 1
bitmap[(101, 100)] = 1
bitmap[(101, 101)] = 1

tile_grid = displayio.TileGrid(bitmap, pixel_shader=palette)
group = displayio.Group()
group.append(tile_grid)
board.DISPLAY.show(group)
board.DISPLAY.refresh_soon()

run the above get the expected little square:
color16
change this line to:

COLORS = 17

run again and some kind of repetition happens:
color17

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions