34
34
__repo__ = "https://github.com/Adafruit/Adafruit_CircuitPython_FancyLED.git"
35
35
36
36
37
+ # Function names are kept the same as FastLED, which normally upsets pylint.
38
+ # Disable name-checking so this passes muster.
39
+ # pylint: disable=invalid-name
40
+
37
41
"""
38
42
FancyLED is sort of a mild CircuitPython interpretation of a subset
39
43
of the FastLED library for Arduino. This is mainly to assist with
@@ -84,13 +88,13 @@ def applyGamma_video(n, g_r=GFACTOR, g_g=None, g_b=None, inplace=False):
84
88
# fall back on the RGB tuple case.
85
89
try :
86
90
if inplace :
87
- for i in range ( len ( n ) ):
91
+ for i in enumerate ( n ):
88
92
n [i ] = applyGamma_video (n [i ], g_r , g_g , g_b )
89
- else :
90
- newlist = []
91
- for i in n :
92
- newlist += applyGamma_video (i , g_r , g_g , g_b )
93
- return newlist
93
+ return None
94
+ newlist = []
95
+ for i in n :
96
+ newlist += applyGamma_video (i , g_r , g_g , g_b )
97
+ return newlist
94
98
except TypeError :
95
99
if g_g is None :
96
100
g_g = g_r
@@ -100,10 +104,10 @@ def applyGamma_video(n, g_r=GFACTOR, g_g=None, g_b=None, inplace=False):
100
104
n [0 ] = applyGamma_video (n [0 ], g_r )
101
105
n [1 ] = applyGamma_video (n [1 ], g_g )
102
106
n [2 ] = applyGamma_video (n [2 ], g_b )
103
- else :
104
- return [applyGamma_video (n [0 ], g_r ),
105
- applyGamma_video (n [1 ], g_g ),
106
- applyGamma_video (n [2 ], g_b )]
107
+ return None
108
+ return [applyGamma_video (n [0 ], g_r ),
109
+ applyGamma_video (n [1 ], g_g ),
110
+ applyGamma_video (n [2 ], g_b )]
107
111
108
112
109
113
def napplyGamma_video (n , g_r = GFACTOR , g_g = None , g_b = None ):
@@ -266,3 +270,6 @@ def hsv2rgb_spectrum(hsv):
266
270
return [(((((r * sat1 ) >> 8 ) + sat2 ) * val1 ) >> 8 ) & 0xFF ,
267
271
(((((g * sat1 ) >> 8 ) + sat2 ) * val1 ) >> 8 ) & 0xFF ,
268
272
(((((b * sat1 ) >> 8 ) + sat2 ) * val1 ) >> 8 ) & 0xFF ]
273
+
274
+
275
+ # pylint: enable=invalid-name
0 commit comments