MCPcopy Create free account
hub / github.com/FastLED/FastLED / changeToRandomPalette

Method changeToRandomPalette

src/fl/fx/2d/noisepalette.cpp.hpp:184–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184u8 NoisePalette::changeToRandomPalette() {
185 while (true) {
186 u8 new_idx = random8() % 12;
187 if (new_idx == currentPaletteIndex) {
188 continue;
189 }
190 currentPaletteIndex = new_idx;
191 setPalettePreset(currentPaletteIndex);
192 return currentPaletteIndex;
193 }
194}
195
196} // namespace fl

Callers 1

loopFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected