Skip to content

Commit d84d550

Browse files
author
Jonathan Dahan
committed
Fix fill
1 parent d8b8238 commit d84d550

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_framebuf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ def get_pixel(framebuf, x, y):
6868
def fill(framebuf, color):
6969
"""completely fill/clear the buffer with a color"""
7070
if color:
71-
fill = color & 0b11
71+
bits = (color & 0b11)
72+
fill = (bits << 6) | (bits << 4) | (bits << 2) | (bits << 0)
7273
else:
7374
fill = 0x00
7475
for i in range(len(framebuf.buf)): # pylint: disable=consider-using-enumerate

0 commit comments

Comments
 (0)