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

◆ blendAlphaMaxChannel()

CRGB CRGB::blendAlphaMaxChannel ( const CRGB & upper,
const CRGB & lower )
static

Definition at line 58 of file crgb.cpp.

58 {
59 // Use luma of upper pixel as alpha (0..255)
60 uint8_t max_component = 0;
61 for (int i = 0; i < 3; ++i) {
62 if (upper.raw[i] > max_component) {
63 max_component = upper.raw[i];
64 }
65 }
66 // uint8_t alpha = upper.getLuma();
67 // blend(lower, upper, alpha) → (lower * (255−alpha) + upper * alpha) / 256
68 uint8_t amountOf2 = 255 - max_component;
69 return CRGB::blend(upper, lower, amountOf2);
70}
static CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
Definition crgb.cpp:50

References CRGB(), and blend().

Referenced by fl::Frame::draw(), and fl::Frame::drawXY().

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