Skip to content

Commit 0dbfcf1

Browse files
committed
fix mock Bitmap interface for tests
1 parent b064509 commit 0dbfcf1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/displayio_shared_bindings.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ def __init__(self, width: int, height: int, colors: int) -> None:
5050
self.height = height
5151
self.colors = colors
5252
self.data = {}
53+
bits = 1
54+
while (colors - 1) >> bits:
55+
if bits < 8:
56+
bits = bits << 1
57+
else:
58+
bits += 8
59+
self._bits_per_value = bits
5360

5461
def _abs_pos(self, width: int, height: int) -> int:
5562
if height >= self.height:

0 commit comments

Comments
 (0)