Files
portal/src/patterns/solid.py
T
jimmyandCursor 3d444d1cb5 Ship the portal FastAPI controller with presets, sequences, and live audio.
Move the app under src/, add ring-spanning patterns with shared fonts and
beat-driven motion, and wire global audio settings into the web UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-09 00:59:03 +12:00

27 lines
589 B
Python

#!/usr/bin/env python3
"""Solid fill cycling through declared colours."""
from __future__ import annotations
from leds.pattern import Color, Pattern, run_cli
class Solid(Pattern):
id = "solid"
label = "Solid"
fps = 1
colors = {
"a": Color("#ff0000"),
"b": Color("#00ff00"),
"c": Color("#0000ff"),
}
def draw(self, surface, t, params):
palette = list(params["colors"].values()) or [(255, 0, 0)]
frame = int(t * self.fps)
surface.fill(palette[frame % len(palette)])
if __name__ == "__main__":
run_cli(Solid)