Skip to content

Commit a85229e

Browse files
committed
Fix typing for color565 function
1 parent 8cfb0db commit a85229e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_rgb_display/rgb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@
4747

4848

4949
def color565(
50-
r: Union[int, Tuple[int, int, int], List[int]],
51-
g: int = 0,
52-
b: int = 0,
50+
r: Union[int, Tuple[int, int, int], List[int, int, int]],
51+
g: Optional[int] = 0,
52+
b: Optional[int] = 0,
5353
) -> int:
5454
"""Convert red, green and blue values (0-255) into a 16-bit 565 encoding. As
5555
a convenience this is also available in the parent adafruit_rgb_display
5656
package namespace."""
57-
if not isinstance(r, int): # see if the first var is a tuple/list
57+
if isinstance(r, (tuple, list)): # see if the first var is a tuple/list
5858
red, g, b = r
5959
else:
6060
red = r

0 commit comments

Comments
 (0)