Skip to content

SolidEffect

Source: SolidEffect.h

SolidEffect

class SolidEffect
src/light/effects/SolidEffect.h:27

Inherits: EffectBase

Effect that fills the whole layer with one palette color.

SolidEffect card SolidEffect controls

Five color modes: a flat color, the palette across the lights, its RMS average, or banded. Brightness scales the flat and spread results.

Prior art: MoonLight's Solid, whose modes and shuffle this reproduces.

Public Attributes

uint8_t red = 182 : The flat color's red channel.

uint8_t green = 15 : Its green channel.

uint8_t blue = 98 : Its blue channel.

uint8_t white = 0 : Its white channel, written only where the light carries one.

uint8_t brightness = 255 : Scales the flat and palette-spread results.

uint8_t colorMode = 0 : Which of the five color modes fills the layer.

uint8_t minRGB = 10 : The band modes drop palette entries darker than this on every channel.

bool randomColors = false : The band modes shuffle the surviving entries, reproducibly.

Public Methods

virtual inline const char * tags() const override : Catalog tags: MoonLight origin.

virtual inline Dim dimensions() const override : D3: the band modes write every axis, which keeps their orientation right in a volume.

virtual inline void defineControls() override : Publish the flat color, the brightness, the mode and the band filters.

virtual inline void prepare() override : Allocate the band modes' wheel-index table, kept off the inline footprint.

virtual inline void tick() override : Fill the layer in the selected mode, clearing any stale white behind it.

Public Static Attributes

constexpr const char * kColorModeOptions = { "RGB(W)", "Palette", "Palette avg", "Palette rows", "Palette cols"}

constexpr uint8_t kColorModeCount = 5 : How many color modes the select offers.

More info

The band modes

A minRGB floor drops near-black palette entries, so a dark gradient still bands visibly. randomColors shuffles the survivors with a fixed generator, so the order is reproducible. The flat color's own members go unused in every palette mode.

White is written only where the light has it

The optional white channel is written when the layer carries a fourth, and ignored otherwise. Every palette mode clears it, since those modes carry no white source of their own.