Skip to content

Commit eda3772

Browse files
authored
Merge pull request #73 from kattni/color-doc-fix
Renders color.py in Sphinx documentation.
2 parents ba976f2 + 1fbf719 commit eda3772

File tree

1 file changed

+46
-9
lines changed

1 file changed

+46
-9
lines changed

adafruit_led_animation/color.py

+46-9
Original file line numberDiff line numberDiff line change
@@ -19,50 +19,87 @@
1919
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
# THE SOFTWARE.
22-
"""Color variables made available for import for CircuitPython LED animations library.
22+
"""
23+
`adafruit_led_animation.color`
24+
================================================================================
25+
26+
Color variables assigned to RGB values made available for import.
27+
28+
* Author(s): Kattni Rembor
29+
30+
Implementation Notes
31+
--------------------
2332
24-
RGBW_WHITE_RGB is for RGBW strips to illuminate only the RGB diodes.
25-
RGBW_WHITE_W is for RGBW strips to illuminate only White diode.
26-
RGBW_WHITE_RGBW is for RGBW strips to illuminate the RGB and White diodes.
33+
**Hardware:**
2734
28-
RAINBOW is a list of colors to use for cycling through.
35+
* `Adafruit NeoPixels <https://www.adafruit.com/category/168>`_
36+
* `Adafruit DotStars <https://www.adafruit.com/category/885>`_
37+
38+
**Software and Dependencies:**
39+
40+
* Adafruit CircuitPython firmware for the supported boards:
41+
https://circuitpython.org/downloads
2942
"""
3043
RED = (255, 0, 0)
44+
"""Red."""
3145
YELLOW = (255, 150, 0)
46+
"""Yellow."""
3247
ORANGE = (255, 40, 0)
48+
"""Orange."""
3349
GREEN = (0, 255, 0)
50+
"""Green."""
3451
TEAL = (0, 255, 120)
52+
"""Teal."""
3553
CYAN = (0, 255, 255)
54+
"""Cyan."""
3655
BLUE = (0, 0, 255)
56+
"""Blue."""
3757
PURPLE = (180, 0, 255)
58+
"""Purple."""
3859
MAGENTA = (255, 0, 20)
60+
"""Magenta."""
3961
WHITE = (255, 255, 255)
62+
"""White."""
4063
BLACK = (0, 0, 0)
64+
"""Black or off."""
4165

4266
GOLD = (255, 222, 30)
67+
"""Gold."""
4368
PINK = (242, 90, 255)
69+
"""Pink."""
4470
AQUA = (50, 255, 255)
71+
"""Aqua."""
4572
JADE = (0, 255, 40)
73+
"""Jade."""
4674
AMBER = (255, 100, 0)
75+
"""Amber."""
4776
OLD_LACE = (253, 245, 230) # Warm white.
77+
"""Old lace or warm white."""
4878

4979
RGBW_WHITE_RGB = (255, 255, 255, 0)
80+
"""RGBW_WHITE_RGB is for RGBW strips to illuminate only the RGB diodes."""
5081
RGBW_WHITE_W = (0, 0, 0, 255)
82+
"""RGBW_WHITE_W is for RGBW strips to illuminate only White diode."""
5183
RGBW_WHITE_RGBW = (255, 255, 255, 255)
84+
"""RGBW_WHITE_RGBW is for RGBW strips to illuminate the RGB and White diodes."""
5285

5386
RAINBOW = (RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
87+
"""RAINBOW is a list of colors to use for cycling through.
88+
Includes, in order: red, orange, yellow, green, blue, and purple."""
5489

5590
try:
5691
try:
57-
# Backwards compat for 5.3.0 and prior
92+
# Backwards compatibility for 5.3.0 and prior
5893
from _pixelbuf import colorwheel # pylint: disable=unused-import
5994
except ImportError:
6095
from _pixelbuf import wheel as colorwheel # pylint: disable=unused-import
6196
except ImportError:
62-
# Ensure we have a wheel if not built in
97+
6398
def colorwheel(pos):
64-
"""Input a value 0 to 255 to get a color value.
65-
The colours are a transition r - g - b - back to r."""
99+
"""Colorwheel is built into CircuitPython's _pixelbuf. A separate colorwheel is included
100+
here for use with CircuitPython builds that do not include _pixelbuf, as with some of the
101+
SAMD21 builds. To use: input a value 0 to 255 to get a color value.
102+
The colours are a transition from red to green to blue and back to red."""
66103
if pos < 0 or pos > 255:
67104
return 0, 0, 0
68105
if pos < 85:

0 commit comments

Comments
 (0)