4
4
import atexit
5
5
6
6
7
- try :
8
- xrange (0 )
9
- except NameError :
10
- xrange = range
11
-
12
-
13
7
def Color (red , green , blue , white = 0 ):
14
8
"""Convert the provided red, green, blue color to a 24-bit color value.
15
9
Each color component should be a value 0-255 where 0 is the lowest intensity
@@ -81,7 +75,7 @@ def __getitem__(self, pos):
81
75
# Handle if a slice of positions are passed in by grabbing all the values
82
76
# and returning them in a list.
83
77
if isinstance (pos , slice ):
84
- return [ws .ws2811_led_get (self ._channel , n ) for n in xrange (* pos .indices (self .size ))]
78
+ return [ws .ws2811_led_get (self ._channel , n ) for n in range (* pos .indices (self .size ))]
85
79
# Else assume the passed in value is a number to the position.
86
80
else :
87
81
return ws .ws2811_led_get (self ._channel , pos )
@@ -93,7 +87,7 @@ def __setitem__(self, pos, value):
93
87
# Handle if a slice of positions are passed in by setting the appropriate
94
88
# LED data values to the provided value.
95
89
if isinstance (pos , slice ):
96
- for n in xrange (* pos .indices (self .size )):
90
+ for n in range (* pos .indices (self .size )):
97
91
ws .ws2811_led_set (self ._channel , n , value )
98
92
# Else assume the passed in value is a number to the position.
99
93
else :
0 commit comments