solid.py
1 # SPDX-FileCopyrightText: 2020 Kattni Rembor for Adafruit Industries 2 # 3 # SPDX-License-Identifier: MIT 4 5 """ 6 `adafruit_led_animation.animation.solid` 7 ================================================================================ 8 9 Solid animation for CircuitPython helper library for LED animations. 10 11 * Author(s): Kattni Rembor 12 13 Implementation Notes 14 -------------------- 15 16 **Hardware:** 17 18 * `Adafruit NeoPixels <https://www.adafruit.com/category/168>`_ 19 * `Adafruit DotStars <https://www.adafruit.com/category/885>`_ 20 21 **Software and Dependencies:** 22 23 * Adafruit CircuitPython firmware for the supported boards: 24 https://circuitpython.org/downloads 25 26 27 """ 28 29 from adafruit_led_animation.animation.colorcycle import ColorCycle 30 31 32 class Solid(ColorCycle): 33 """ 34 A solid color. 35 36 :param pixel_object: The initialised LED object. 37 :param color: Animation color in ``(r, g, b)`` tuple, or ``0x000000`` hex format. 38 """ 39 40 def __init__(self, pixel_object, color, name=None): 41 super().__init__(pixel_object, speed=1, colors=[color], name=name) 42 43 def _set_color(self, color): 44 self.colors = [color]