Skip to content
This repository was archived by the owner on Apr 20, 2022. It is now read-only.

Commit b4eccfc

Browse files
authored
Merge pull request #27 from kattni/colorwheel
Update wheel to colorwheel to match _pixelbuf.
2 parents 49cadeb + 1f1d8db commit b4eccfc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

adafruit_pypixelbuf.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ def parse_byteorder(byteorder):
134134
r = byteorder.index("R")
135135
g = byteorder.index("G")
136136
b = byteorder.index("B")
137-
except ValueError:
138-
raise ValueError("Invalid Byteorder string")
137+
except ValueError as exc:
138+
raise ValueError("Invalid Byteorder string") from exc
139139
if "W" in byteorder:
140140
w = byteorder.index("W")
141141
byteorder = (r, g, b, w)
@@ -354,7 +354,7 @@ def _transmit(self, buffer):
354354
raise NotImplementedError("Must be subclassed")
355355

356356

357-
def wheel(pos):
357+
def colorwheel(pos):
358358
"""
359359
Helper to create a colorwheel.
360360
@@ -372,3 +372,7 @@ def wheel(pos):
372372
return 0, 255 - pos * 3, pos * 3
373373
pos -= 170
374374
return pos * 3, 0, 255 - pos * 3
375+
376+
377+
# Use of wheel() is deprecated. Please use colorwheel().
378+
wheel = colorwheel

0 commit comments

Comments
 (0)