Adafruit_CircuitPython_LED_.../adafruit_led_animation/animation/solid.py
2021-01-12 10:37:24 -05:00

44 lines
1.1 KiB
Python

# SPDX-FileCopyrightText: 2020 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_led_animation.animation.solid`
================================================================================
Solid animation for CircuitPython helper library for LED animations.
* Author(s): Kattni Rembor
Implementation Notes
--------------------
**Hardware:**
* `Adafruit NeoPixels <https://www.adafruit.com/category/168>`_
* `Adafruit DotStars <https://www.adafruit.com/category/885>`_
**Software and Dependencies:**
* Adafruit CircuitPython firmware for the supported boards:
https://circuitpython.org/downloads
"""
from adafruit_led_animation.animation.colorcycle import ColorCycle
class Solid(ColorCycle):
"""
A solid color.
:param pixel_object: The initialised LED object.
:param color: Animation color in ``(r, g, b)`` tuple, or ``0x000000`` hex format.
"""
def __init__(self, pixel_object, color, name=None):
super().__init__(pixel_object, speed=1, colors=[color], name=name)
def _set_color(self, color):
self.colors = [color]