Skip to content

Commit

Permalink
Merge pull request #40 from cpforbes/cpf-list-fix
Browse files Browse the repository at this point in the history
Revert use of ternary; tuple addition failed when color is a list.
  • Loading branch information
tannewt authored Feb 5, 2019
2 parents 6e35cd2 + 845c0b4 commit c0ed348
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion neopixel.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ def _set_item(self, index, value):
g = 0
b = 0
elif (len(value) == self.bpp) or ((len(value) == 3) and (self.bpp == 4)):
r, g, b, w = value if len(value) == 4 else value+(0,)
if len(value) == 3:
r, g, b = value
else:
r, g, b, w = value
else:
raise ValueError("Color tuple size does not match pixel_order.")

Expand Down

0 comments on commit c0ed348

Please sign in to comment.