FastLED 3.10.6
Loading...
Searching...
No Matches

◆ operator!=

FASTLED_FORCE_INLINE bool operator!= ( const hsv8 & lhs,
const hsv8 & rhs )
friend

Compare two HSV colors field by field.

Without these, a == b on two CHSV values found no operator on the type and instead converted BOTH operands to RGB, comparing the rendering rather than the colors. Anything that renders alike then compared equal: CHSV(0,0,0) == CHSV(128,0,0) was true (both black), and so was CHSV(10,20,30) == CHSV(10,20,31) (both round to the same RGB). Reported in 2018 as FastLED#691.

Hidden friends rather than members: C++20 synthesizes a reversed candidate for a member operator==, which trips -Wambiguous-reversed-operator at every call site. Same reasoning and same shape as the palette comparisons in colorutils.h (#2724).

Definition at line 83 of file hsv.h.

85 {
86 return !(lhs == rhs);
87 }

References hsv8(), FASTLED_FORCE_INLINE, and fl::FL_NO_EXCEPT.