diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a74f4c7..93924d24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - AVAHI included in Webserver (#996) - Fix add libcec to deb/rpm dependency list - Fix Hyperion configuration is corrected during start-up, if required +- Fix color comparison / Signal detection (#1087) ### Removed - Replace Multi-Lightpack by multi-instance Lightpack configuration (#1049) diff --git a/include/utils/ColorRgb.h b/include/utils/ColorRgb.h index 780f44d0..7f11849c 100644 --- a/include/utils/ColorRgb.h +++ b/include/utils/ColorRgb.h @@ -97,17 +97,23 @@ inline bool operator!=(const ColorRgb & lhs, const ColorRgb & rhs) /// Compare operator to check if a color is 'smaller' than or 'equal' to another color inline bool operator<=(const ColorRgb & lhs, const ColorRgb & rhs) { - return lhs < rhs || lhs == rhs; + return lhs.red <= rhs.red && + lhs.green <= rhs.green && + lhs.blue <= rhs.blue; } /// Compare operator to check if a color is 'greater' to another color inline bool operator>(const ColorRgb & lhs, const ColorRgb & rhs) { - return !(lhs < rhs) && lhs != rhs; + return lhs.red > rhs.red && + lhs.green > rhs.green && + lhs.blue > rhs.blue; } /// Compare operator to check if a color is 'greater' than or 'equal' to another color inline bool operator>=(const ColorRgb & lhs, const ColorRgb & rhs) { - return lhs > rhs || lhs == rhs; + return lhs.red >= rhs.red && + lhs.green >= rhs.green && + lhs.blue >= rhs.blue; }