Skip to content

Commit

Permalink
Fix/no signal detection (#1087)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenoist authored Nov 18, 2020
1 parent a0311bd commit c4e15db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 9 additions & 3 deletions include/utils/ColorRgb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit c4e15db

Please sign in to comment.