Skip to content

Commit c4e15db

Browse files
authored
Fix/no signal detection (#1087)
1 parent a0311bd commit c4e15db

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4848
- AVAHI included in Webserver (#996)
4949
- Fix add libcec to deb/rpm dependency list
5050
- Fix Hyperion configuration is corrected during start-up, if required
51+
- Fix color comparison / Signal detection (#1087)
5152

5253
### Removed
5354
- Replace Multi-Lightpack by multi-instance Lightpack configuration (#1049)

include/utils/ColorRgb.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,23 @@ inline bool operator!=(const ColorRgb & lhs, const ColorRgb & rhs)
9797
/// Compare operator to check if a color is 'smaller' than or 'equal' to another color
9898
inline bool operator<=(const ColorRgb & lhs, const ColorRgb & rhs)
9999
{
100-
return lhs < rhs || lhs == rhs;
100+
return lhs.red <= rhs.red &&
101+
lhs.green <= rhs.green &&
102+
lhs.blue <= rhs.blue;
101103
}
102104

103105
/// Compare operator to check if a color is 'greater' to another color
104106
inline bool operator>(const ColorRgb & lhs, const ColorRgb & rhs)
105107
{
106-
return !(lhs < rhs) && lhs != rhs;
108+
return lhs.red > rhs.red &&
109+
lhs.green > rhs.green &&
110+
lhs.blue > rhs.blue;
107111
}
108112

109113
/// Compare operator to check if a color is 'greater' than or 'equal' to another color
110114
inline bool operator>=(const ColorRgb & lhs, const ColorRgb & rhs)
111115
{
112-
return lhs > rhs || lhs == rhs;
116+
return lhs.red >= rhs.red &&
117+
lhs.green >= rhs.green &&
118+
lhs.blue >= rhs.blue;
113119
}

0 commit comments

Comments
 (0)