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

◆ NoisePalette()

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

Definition at line 18 of file noisepalette.cpp.

19 : Fx2d(xyMap), speed(0), scale(0), colorLoop(1), mFps(fps) {
20 // currentPalette = PartyColors_p;
21 static_assert(sizeof(currentPalette) == sizeof(CRGBPalette16),
22 "Palette size mismatch");
24 width = xyMap.getWidth();
25 height = xyMap.getHeight();
26
27 // Initialize our coordinates to some random values
28 mX = random16();
29 mY = random16();
30 mZ = random16();
31
33
34 // Allocate memory for the noise array using scoped_ptr
35 noise = scoped_array<uint8_t>(new uint8_t[width * height]);
36}
uint16_t xyMap(uint16_t x, uint16_t y) const
Definition fx2d.h:21
Fx2d(const XYMap &xyMap)
Definition fx2d.h:20
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:56

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: