FastLED 3.9.15
Loading...
Searching...
No Matches

◆ subtractFromRGB()

FASTLED_FORCE_INLINE CRGB & CRGB::subtractFromRGB ( uint8_t d)

Subtract a constant from each channel, saturating at 0x00.

Note
This is NOT an operator+= overload because the compiler can't usefully decide when it's being passed a 32-bit constant (e.g. CRGB::Red) and an 8-bit one (CRGB::Blue)

Definition at line 62 of file crgb.hpp.

63{
64 r = qsub8( r, d);
65 g = qsub8( g, d);
66 b = qsub8( b, d);
67 return *this;
68}
LIB8STATIC_ALWAYS_INLINE uint8_t qsub8(uint8_t i, uint8_t j)
Subtract one byte from another, saturating at 0x00.
Definition math8.h:103

References CRGB(), FASTLED_FORCE_INLINE, and qsub8().

Referenced by operator--().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: