Mk2 to prepare color.h for idf >= 5 (#5070)

This commit is contained in:
Jimmy Hedman 2023-07-13 02:32:05 +02:00 committed by GitHub
parent ac05495781
commit f8df694aa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,21 +57,6 @@ struct Color {
inline bool operator!=(uint32_t colorcode) { // NOLINT inline bool operator!=(uint32_t colorcode) { // NOLINT
return this->raw_32 != colorcode; 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 uint8_t &operator[](uint8_t x) ALWAYS_INLINE { return this->raw[x]; }
inline Color operator*(uint8_t scale) const ALWAYS_INLINE { 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), return Color(esp_scale8(this->red, scale), esp_scale8(this->green, scale), esp_scale8(this->blue, scale),