mirror of
https://github.com/esphome/esphome.git
synced 2024-12-19 16:07:47 +01:00
add color compare operator's (#3730)
This commit is contained in:
parent
b854e17995
commit
63290a265c
@ -44,6 +44,20 @@ struct Color {
|
|||||||
w((colorcode >> 24) & 0xFF) {}
|
w((colorcode >> 24) & 0xFF) {}
|
||||||
|
|
||||||
inline bool is_on() ALWAYS_INLINE { return this->raw_32 != 0; }
|
inline bool is_on() ALWAYS_INLINE { return this->raw_32 != 0; }
|
||||||
|
|
||||||
|
inline bool operator==(const Color &rhs) { // NOLINT
|
||||||
|
return this->raw_32 == rhs.raw_32;
|
||||||
|
}
|
||||||
|
inline bool operator==(uint32_t colorcode) { // NOLINT
|
||||||
|
return this->raw_32 == colorcode;
|
||||||
|
}
|
||||||
|
inline bool operator!=(const Color &rhs) { // NOLINT
|
||||||
|
return this->raw_32 != rhs.raw_32;
|
||||||
|
}
|
||||||
|
inline bool operator!=(uint32_t colorcode) { // NOLINT
|
||||||
|
return this->raw_32 != colorcode;
|
||||||
|
}
|
||||||
|
|
||||||
inline Color &operator=(const Color &rhs) ALWAYS_INLINE { // NOLINT
|
inline Color &operator=(const Color &rhs) ALWAYS_INLINE { // NOLINT
|
||||||
this->r = rhs.r;
|
this->r = rhs.r;
|
||||||
this->g = rhs.g;
|
this->g = rhs.g;
|
||||||
|
Loading…
Reference in New Issue
Block a user