Fix/no signal detection (#1087)

This commit is contained in:
Florent Benoist
2020-11-18 19:25:43 +01:00
committed by GitHub
parent a0311bd8b5
commit c4e15dba00
2 changed files with 10 additions and 3 deletions

View File

@@ -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;
}