feat: add variable to toggle the rainbow effect on or off

This commit is contained in:
Philip Stark 2023-06-10 14:01:29 +02:00
parent 03a012650f
commit e4bdcf71dc
2 changed files with 8 additions and 0 deletions

View file

@ -114,10 +114,15 @@ Color Wordclock::get_next_color_base_(uint32_t position, uint32_t speed, uint16_
}
Color Wordclock::get_next_color(uint32_t position, const Color &current_color) {
if (this->effect_active) {
uint32_t speed_ = 3;
uint16_t width_ = 100; // Original width_ = 50
return get_next_color_base_(position, speed_, width_, current_color);
}
else {
return Color(this->on_color);
}
}
int8_t Wordclock::find_hour(uint8_t target_value) {
std::vector<Hour> *elements = this->hours;