Skip to content

Commit 89ec2b0

Browse files
author
Melissa LeBlanc-Williams
committed
Changed 16-bit color function name
1 parent a8f36b9 commit 89ec2b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/ra8875_bmptest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
display.init()
2828
display.fill(WHITE)
2929

30-
def color555(rgb):
30+
def convert_555_to_565(rgb):
3131
return (rgb & 0x7FE0) << 1 | 0x20 | rgb & 0x001F
3232

3333
class BMP(object):
@@ -75,7 +75,7 @@ def draw(self, disp, x=0, y=0):
7575
if (line_size-i) < self.bpp//8:
7676
break
7777
if self.bpp == 16:
78-
color = color555(line_data[i] | line_data[i+1] << 8)
78+
color = convert_555_to_565(line_data[i] | line_data[i+1] << 8)
7979
if self.bpp == 24 or self.bpp == 32:
8080
color = color565(line_data[i+2], line_data[i+1], line_data[i])
8181
current_line_data = current_line_data + struct.pack(">H", color)

0 commit comments

Comments
 (0)