-
Notifications
You must be signed in to change notification settings - Fork 101
throw error if color tuple/pixel_order mismatch #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
That is what I would suggest. But looking at the logic for when an |
updated PR to capture discussion - I hope:
|
neopixel.py
Outdated
r, g, b = value | ||
elif (len(value) == self.bpp) or ((len(value) == 3) and (self.bpp == 4)): | ||
if len(value) == 3: | ||
r, g, b = value[0:3] | ||
else: | ||
r, g, b, w = value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if/else could be replaced with a ternary:
r, g, b, w = value if len(value)==4 else value+(0,)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me! Thanks.
Updating https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel to 3.3.4 from 3.3.2: > Merge pull request adafruit/Adafruit_CircuitPython_NeoPixel#37 from jerryneedell/jerryn_order > Merge pull request adafruit/Adafruit_CircuitPython_NeoPixel#36 from adafruit/ladyada-patch-1 > Merge pull request adafruit/Adafruit_CircuitPython_NeoPixel#35 from kattni/rpi-example Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Added the following libraries: Adafruit_CircuitPython_NeoTrellis
Is this what you had in mind to address #34 ?