FastLED 3.9.15
Loading...
Searching...
No Matches

◆ NoisePalette()

fl::NoisePalette::NoisePalette ( XYMap xyMap,
float fps = 60.f )

Definition at line 19 of file noisepalette.cpp.

20 : Fx2d(xyMap), speed(0), scale(0), colorLoop(1), mFps(fps) {
21 // currentPalette = PartyColors_p;
22 static_assert(sizeof(currentPalette) == sizeof(CRGBPalette16),
23 "Palette size mismatch");
25 width = xyMap.getWidth();
26 height = xyMap.getHeight();
27
28 // Initialize our coordinates to some random values
29 mX = random16();
30 mY = random16();
31 mZ = random16();
32
34
35 // Allocate memory for the noise array using scoped_ptr
36 noise = scoped_array<uint8_t>(new uint8_t[width * height]);
37}
uint16_t xyMap(uint16_t x, uint16_t y) const
Definition fx2d.h:20
Fx2d(const XYMap &xyMap)
Definition fx2d.h:19
CRGBPalette16 currentPalette
fl::scoped_array< uint8_t > noise
void setPalettePreset(int paletteIndex)
const TProgmemRGBPalette16 PartyColors_p
HSV color ramp: blue, purple, pink, red, orange, yellow (and back).
LIB8STATIC uint16_t random16()
Generate a 16-bit random number.
Definition random8.h:54

References fl::Fx2d::Fx2d(), colorLoop, currentPalette, height, mFps, mX, mY, mZ, noise, PartyColors_p, random16(), scale, setPalettePreset(), speed, width, and fl::Fx2d::xyMap().

+ Here is the call graph for this function: