Skip to content

Commit ba22dbd

Browse files
committed
RGBW handles None g/b values
Found during testing Signed-off-by: David Greaves <[email protected]>
1 parent 9fbe9b6 commit ba22dbd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/rpi_ws281x/rpi_ws281x.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ def __new__(self, r, g=None, b=None, w=None):
1111
else:
1212
if w is None:
1313
w = 0
14+
if g is None:
15+
g = 0
16+
if b is None:
17+
b = 0
1418
return int.__new__(self, (w << 24) | (r << 16) | (g << 8) | b)
1519

1620
@property

0 commit comments

Comments
 (0)