44import atexit
55
66
7- try :
8- xrange (0 )
9- except NameError :
10- xrange = range
11-
12-
137def Color (red , green , blue , white = 0 ):
148 """Convert the provided red, green, blue color to a 24-bit color value.
159 Each color component should be a value 0-255 where 0 is the lowest intensity
@@ -81,7 +75,7 @@ def __getitem__(self, pos):
8175 # Handle if a slice of positions are passed in by grabbing all the values
8276 # and returning them in a list.
8377 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 ))]
8579 # Else assume the passed in value is a number to the position.
8680 else :
8781 return ws .ws2811_led_get (self ._channel , pos )
@@ -93,7 +87,7 @@ def __setitem__(self, pos, value):
9387 # Handle if a slice of positions are passed in by setting the appropriate
9488 # LED data values to the provided value.
9589 if isinstance (pos , slice ):
96- for n in xrange (* pos .indices (self .size )):
90+ for n in range (* pos .indices (self .size )):
9791 ws .ws2811_led_set (self ._channel , n , value )
9892 # Else assume the passed in value is a number to the position.
9993 else :
0 commit comments