Skip to content

Commit

Permalink
Mk2 to prepare color.h for idf >= 5 (esphome#5070)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeMan committed Jul 13, 2023
1 parent ac05495 commit f8df694
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions esphome/core/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit f8df694

Please sign in to comment.