23 lines
552 B
C++
23 lines
552 B
C++
#include "effect_confetti.h"
|
|
#include "config.h"
|
|
#include "functions.h"
|
|
#include "prototypes.h"
|
|
|
|
void ConfettiEffect::loop(uint16_t ms) {
|
|
window->fadeToBlackBy(3);
|
|
for (int i=0; i<settings.effects.confetti.pixels_per_loop; i++) {
|
|
CRGB color = _getColor();
|
|
window->addPixelColor(random16(LED_COUNT), &color);
|
|
}
|
|
}
|
|
|
|
CRGB ConfettiEffect::_getColor() {
|
|
return CHSV(baseHue + random8(64), 255, 255);
|
|
}
|
|
|
|
CRGB RandomConfettiEffect::_getColor() {
|
|
return CHSV(random8(), 255, 255);
|
|
}
|
|
|
|
boolean ConfettiEffect::can_be_shown_with_clock() { return true; };
|