Skip to content

RandomEffect

Source: RandomEffect.h

RandomEffect

class RandomEffect
src/light/effects/RandomEffect.h:16

Inherits: EffectBase

Effect that fills the layer with animated random colors.

RandomEffect card RandomEffect controls

The buffer dims a little, then one light takes a random palette color. Over many frames that scatters fading sparkles across the whole volume. fade sets the density: less lets them linger and fill, more leaves quick specks.

Prior art: MoonLight's Random effect.

Public Attributes

uint8_t fade = 70 : How fast a lit light fades, which sets the field's density.

Public Methods

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

virtual inline Dim dimensions() const override : The lit light is picked across the whole volume, so it addresses every axis.

virtual inline void defineControls() override : Publish the fade.

virtual inline void tick() override : Dim the field, then light as many random pixels as the elapsed time has earned.