Shimmer (Seg Line) - AlbertGBarber/PixelSpork GitHub Wiki
See the Documentation Guide for help understanding each page section.
Effect Sample (see here for sample info) (Shown in Red for clarity) |
![]() |
A simple effect. Colors all the pixels in a segment set, dimming each pixel by a random amount each cycle. The pixel colors can be chosen from a single color, a palette, or totally at random. The dimming range is controlled by shimmerMin
and shimmerMax
(0 to 255). If using a palette, the effect looks best when the palette colors are similar. Try it with a Noise Palette.
Note that when using a single color, it will be stored in the effect's local palette, paletteTemp
.
Supports color modes for the shimmering pixels.
The effect is adapted to work on segment lines for 2D use, with each line being a single color. You can also force the effect to be 1D using lineMode
:
- true -- The effect will "shimmer" segment lines (2D).
- false -- The effect will "shimmer" individual pixels (1D). This is useful if you want to use a 2D color mode with individual pixels.
Determines how the shimmer colors will be chosen.
- 0 -- Picks colors from the palette.
- 1 -- Picks colors at random.
ShimmerSL shimmer(mainSegments, 0, 180, 80);
/* The effect will do shimmers in random colors.
The dim range is 0 to 180.
The effect updates at a rate of 80ms
(note this sets randMode = 1) */
ShimmerSL shimmer(mainSegments, CRGB::Red, 0, 230, 100);
/* The effect will do shimmers in red
The dim range is 0 to 230.
The effect updates at a rate of 100ms. */
ShimmerSL shimmer(mainSegments, cybPnkPal_PS, 0, 180, 80);
/* The effect will do shimmers using colors from the cybPnkPal_PS palette
The dim range is 0 to 180.
The effect updates at a rate of 80ms. */
//Constructor using random shimmer colors
ShimmerSL(SegmentSetPS &SegSet, uint8_t ShimmerMin, uint8_t ShimmerMax, uint16_t Rate);
//Constructor using a set shimmer color
ShimmerSL(SegmentSetPS &SegSet, CRGB Color, uint8_t ShimmerMin, uint8_t ShimmerMax, uint16_t Rate);
//Constructor for colors randomly chosen from palette
ShimmerSL(SegmentSetPS &SegSet, palettePS &Palette, uint8_t ShimmerMin, uint8_t ShimmerMax, uint16_t Rate);
-
SegmentSetPS* segSet -- The Segment Set the effect will draw on. See common vars
segSet
entry for more details. -
palettePS* palette (optional, see constructors) -- The set of colors the effect will use. See palettes. It is a pointer. See common vars
palette
entry for more details. -
CRGB color (optional, see constructors) -- A single color for the shimmers. The color will be placed into the effect's local palette,
paletteTemp
for use. -
uint8_t shimmerMin (min 0, max 255) -- The minimum amount of dimming that will be applied to a pixel (0 is no dimming).
-
uint8_t shimmerMax (min 0, max 255) -- The maximum amount of dimming that will be applied to a pixel (255 is max dimming, ie full black).
-
uint16_t* rate -- Update rate (ms). Is a pointer, allowing you to bind it to an external variable. By default it's bound the effect's local variable,
rateOrig
. See common varsrate
entry for more.
-
uint8_t colorMode (default 0) -- The colorMode use for the effect, also see common vars
colorMode
entry for more details. -
bool lineMode (default true) -- Sets the effect to do shimmers along whole segment lines or individual pixels (see lineMode notes in intro).
-
uint8_t randMode (default 0) -- Sets how the shimmer colors will be chosen (See
randMode
notes in intro). -
bool showNow (default true) -- Controls if the effect "draws" during each update cycle by calling
FastLED.show()
. Common to all effects. See common varsshowNow
entry for more details. -
type var (default 255) -- desc
-
void setSingleColor( CRGB color );
Sets the effect to use a single color for the pixels. The color will be placed into the effect's local palette,
paletteTemp
for use. -
void update();
Updates the effect.