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

◆ changeToRandomPalette()

u8 fl::NoisePalette::changeToRandomPalette ( )

Definition at line 184 of file noisepalette.cpp.hpp.

184 {
185 while (true) {
186 u8 new_idx = random8() % 12;
187 if (new_idx == currentPaletteIndex) {
188 continue;
189 }
190 currentPaletteIndex = new_idx;
192 return currentPaletteIndex;
193 }
194}
void setPalettePreset(int paletteIndex)
LIB8STATIC fl::u8 random8() FL_NOEXCEPT
Generate an 8-bit random number.
Definition random8.h:53
unsigned char u8
Definition stdint.h:131

References currentPaletteIndex, random8(), and setPalettePreset().

+ Here is the call graph for this function: