mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-28 00:38:28 +02:00
Nextion colors parameters (#5699)
* Add `foreground` color - Adds `set_component_foreground_color` and `set_component_pressed_foreground_color` which does the same as `set_component_font_color` and `set_component_pressed_font_color` but with a more intuitive name, as this can be used for any component and not only the ones with a text (font). - I've also reviewed some docstring when related to colors. * Add numeric color to drawing methods Should I've used uint32_t instead? In order to keep consistency? * component color support to uint6_t This is the right format and is now consistent with colors on drawings. I'm keeping uint32_t also to avoid breaking changes. * Enforces uint16_t for colors uint32_t is incorrect for Nextion display colors. * Fix clang-format
This commit is contained in:
@@ -99,11 +99,11 @@ void NextionComponent::update_component_settings(bool force_update) {
|
||||
this->bco2_needs_update_ = false;
|
||||
}
|
||||
if (this->pco_needs_update_ || (force_update && this->pco_is_set_)) {
|
||||
this->nextion_->set_component_font_color(this->variable_name_.c_str(), this->pco_);
|
||||
this->nextion_->set_component_foreground_color(this->variable_name_.c_str(), this->pco_);
|
||||
this->pco_needs_update_ = false;
|
||||
}
|
||||
if (this->pco2_needs_update_ || (force_update && this->pco2_is_set_)) {
|
||||
this->nextion_->set_component_pressed_font_color(this->variable_name_.c_str(), this->pco2_);
|
||||
this->nextion_->set_component_pressed_foreground_color(this->variable_name_.c_str(), this->pco2_);
|
||||
this->pco2_needs_update_ = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user