mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 13:34:54 +01:00
Mk2 to prepare color.h for idf >= 5 (#5070)
This commit is contained in:
parent
ac05495781
commit
f8df694aa3
1 changed files with 0 additions and 15 deletions
|
@ -57,21 +57,6 @@ struct Color {
|
|||
inline bool operator!=(uint32_t colorcode) { // NOLINT
|
||||
return this->raw_32 != colorcode;
|
||||
}
|
||||
|
||||
inline Color &operator=(const Color &rhs) ALWAYS_INLINE { // NOLINT
|
||||
this->r = rhs.r;
|
||||
this->g = rhs.g;
|
||||
this->b = rhs.b;
|
||||
this->w = rhs.w;
|
||||
return *this;
|
||||
}
|
||||
inline Color &operator=(uint32_t colorcode) ALWAYS_INLINE {
|
||||
this->w = (colorcode >> 24) & 0xFF;
|
||||
this->r = (colorcode >> 16) & 0xFF;
|
||||
this->g = (colorcode >> 8) & 0xFF;
|
||||
this->b = (colorcode >> 0) & 0xFF;
|
||||
return *this;
|
||||
}
|
||||
inline uint8_t &operator[](uint8_t x) ALWAYS_INLINE { return this->raw[x]; }
|
||||
inline Color operator*(uint8_t scale) const ALWAYS_INLINE {
|
||||
return Color(esp_scale8(this->red, scale), esp_scale8(this->green, scale), esp_scale8(this->blue, scale),
|
||||
|
|
Loading…
Reference in a new issue