Skip to content

Commit b5b17d7

Browse files
author
BiffoBear
committed
Set r, g and b to int to remove typing issue and respect the intent of the doc-string.
1 parent 2b8bbb9 commit b5b17d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_character_lcd/character_lcd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,9 +715,9 @@ def color(self, color: Union[List[int, int, int], int]) -> None:
715715
if color >> 24:
716716
raise ValueError("Integer color value must be positive and 24 bits max")
717717
# NOTE: convert to 0-100
718-
r = (color >> 16) / 2.55
719-
g = ((color >> 8) & 0xFF) / 2.55
720-
b = (color & 0xFF) / 2.55
718+
r = int((color >> 16) / 2.55)
719+
g = int(((color >> 8) & 0xFF) / 2.55)
720+
b = int((color & 0xFF) / 2.55)
721721
color = [r, g, b] # This is List[float], should be List[int]
722722
self._color = color
723723
for number, pin in enumerate(self.rgb_led):

0 commit comments

Comments
 (0)