File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ def monotonic_ms():
36
36
Implementation of monotonic_ms for platforms without time.monotonic_ns
37
37
"""
38
38
return int (monotonic () * MS_PER_SECOND )
39
+
39
40
except (ImportError , NotImplementedError ):
40
41
from time import time_ns
41
42
Original file line number Diff line number Diff line change 27
27
try :
28
28
from rainbowio import colorwheel # pylint: disable=unused-import
29
29
except (ImportError , ModuleNotFoundError ):
30
+
30
31
def colorwheel (pos ):
31
32
# ref: https://github.com/adafruit/circuitpython/blob/main/shared-module/rainbowio/__init__.c
32
33
pos = pos - ((pos // 256 ) * 256 )
33
34
shift1 = 0
34
35
shift2 = 0
35
- if ( pos < 85 ) :
36
+ if pos < 85 :
36
37
shift1 = 8
37
38
shift2 = 16
38
- elif ( pos < 170 ) :
39
+ elif pos < 170 :
39
40
pos -= 85
40
41
shift1 = 0
41
42
shift2 = 8
@@ -47,6 +48,7 @@ def colorwheel(pos):
47
48
p = p if (p < 256 ) else 255
48
49
return (p << shift1 ) | ((255 - p ) << shift2 )
49
50
51
+
50
52
RED = (255 , 0 , 0 )
51
53
"""Red."""
52
54
YELLOW = (255 , 150 , 0 )
You can’t perform that action at this time.
0 commit comments