2 `rainbowio` - Provides the `colorwheel()` function
3 ===========================================================
4 See `CircuitPython:rainbowio` in CircuitPython for more details.
5 Not supported by all boards.
7 * Author(s): Kattni Rembor
11 def colorwheel(color_value):
13 A colorwheel. ``0`` and ``255`` are red, ``85`` is green, and ``170`` is blue, with the values
14 between being the rest of the rainbow.
16 :param int color_value: 0-255 of color value to return
17 :return: tuple of RGB values
19 if color_value < 0 or color_value > 255:
22 return 255 - color_value * 3, color_value * 3, 0
25 return 0, 255 - color_value * 3, color_value * 3
27 return color_value * 3, 0, 255 - color_value * 3