30 {
31
32 uint8_t index_4bit = (index >> 12);
33
34 uint8_t offset = (uint8_t)(index >> 4);
35
36 const CRGB* entry = &(pal[0]) + index_4bit;
37 uint8_t red1 = entry->red;
38 uint8_t green1 = entry->green;
39 uint8_t blue1 = entry->blue;
40
43 if (index_4bit == 15) {
44 entry = &(pal[0]);
45 } else {
46 entry++;
47 }
48
49
50 uint8_t f1 = 255 - offset;
54
55
56 uint8_t red2 = entry->red;
57 uint8_t green2 = entry->green;
58 uint8_t blue2 = entry->blue;
63
64
65 red1 += red2;
66 green1 += green2;
67 blue1 += blue2;
68 }
70
72 }
73 return CRGB(red1, green1, blue1);
74}
UISlider brightness("Brightness", 255, 0, 255, 1)
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
Computes a new color blended some fraction of the way between two other colors.
@ NOBLEND
No interpolation between palette entries.
LIB8STATIC_ALWAYS_INLINE void cleanup_R1()
Clean up the r1 register after a series of *LEAVING_R1_DIRTY calls.
LIB8STATIC_ALWAYS_INLINE uint8_t scale8_LEAVING_R1_DIRTY(uint8_t i, fract8 scale)
This version of scale8() does not clean up the R1 register on AVR.
LIB8STATIC void nscale8x3(uint8_t &r, uint8_t &g, uint8_t &b, fract8 scale)
Scale three one-byte values by a fourth one, which is treated as the numerator of a fraction whose de...
Representation of an RGB pixel (Red, Green, Blue)