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

◆ blendAlphaMaxChannel()

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

Definition at line 59 of file crgb.cpp.

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

References CRGB(), and blend().

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

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