There's a mistake in the Neopixels / Dotstars section where colorwheel is stated to return a tuple, but in reality it returns a 0xRRGGBB int. That text is also mirrored in the learn guide.
The colorwheel() function takes a single value 0-255 hue and returns an (R,G,B) tuple given a single 0-255 hue.
By the way, when I need to convert into a tuple, I found that one-line trick so I don't have to use bitwise operations and stuff.
(You don't need the tuple conversion to index into it).
>>> tuple((0xFF8000).to_bytes(3,"big"))
(255, 128, 0)
>>> tuple(colorwheel(32).to_bytes(3,"big"))
(159, 96, 0)
>>> [x // 2 for x in (0xFF8000).to_bytes(3,"big")]
[127, 64, 0]
There's a mistake in the
Neopixels / Dotstars
section where colorwheel is stated to return a tuple, but in reality it returns a0xRRGGBB
int. That text is also mirrored in the learn guide.By the way, when I need to convert into a tuple, I found that one-line trick so I don't have to use bitwise operations and stuff. (You don't need the tuple conversion to index into it).