pitrix/src/effect_confetti.cpp

23 lines
531 B
C++
Raw Normal View History

2019-05-30 09:12:40 +00:00
#include "effect_confetti.h"
#include "config.h"
#include "functions.h"
#include "prototypes.h"
2019-05-30 09:12:40 +00:00
void ConfettiEffect::loop() {
window->fadeToBlackBy(3);
for (int i=0; i<EFFECT_CONFETTI_PIXELS_PER_LOOP; i++) {
2019-06-19 20:17:10 +00:00
CRGB color = _getColor();
window->addPixelColor(random16(LED_COUNT), &color);
}
2019-05-30 09:12:40 +00:00
}
2019-06-19 20:17:10 +00:00
CRGB ConfettiEffect::_getColor() {
return CHSV(baseHue + random8(64), 255, 255);
}
CRGB RandomConfettiEffect::_getColor() {
return CHSV(random8(), 255, 255);
}
2019-05-30 09:12:40 +00:00
boolean ConfettiEffect::can_be_shown_with_clock() { return true; };