FastLED 3.10.8
Loading...
Searching...
No Matches

◆ changeToRandomPalette()

u8 fl::NoisePalette::changeToRandomPalette ( )

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

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

References currentPaletteIndex, fl::FL_NO_EXCEPT, random8(), and setPalettePreset().

+ Here is the call graph for this function: