feat(effect): add attributes, getters, and setters for effect-speed and -width

This commit is contained in:
Philip Stark 2023-06-10 18:50:46 +02:00
parent 47f31301dd
commit c54ff63f89
3 changed files with 47 additions and 1 deletions

View file

@ -83,6 +83,13 @@ public:
}
bool get_effect_active() { return this->effect_active; }
void set_effect_active(bool x) { this->effect_active = x; }
bool get_effect_width() { return this->effect_width; }
void set_effect_width(bool x) { this->effect_width = x; }
bool get_effect_speed() { return this->effect_speed; }
void set_effect_speed(bool x) { this->effect_speed = x; }
void set_on_color(Color on_color) {
this->on_color = on_color;
}
@ -147,11 +154,12 @@ protected:
uint32_t current_position{0};
bool effect_active{true};
uint32_t effect_speed{12};
uint16_t effect_width{50};
Color get_next_color_base_(uint32_t position, uint32_t speed, uint16_t width, const Color &current_color);
Color get_next_color(uint32_t position, const Color &current_color);
// Utils
int8_t find_hour(uint8_t target_value);
int8_t find_minute(uint8_t target_value);