#!/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)