1065 {
1066
1067 uint8_t index_8bit = index >> 8;
1068
1069 uint8_t offset = index & 0xff;
1070
1071 const CRGB* entry = &(pal[0]) + index_8bit;
1072 uint8_t red1 = entry->red;
1073 uint8_t green1 = entry->green;
1074 uint8_t blue1 = entry->blue;
1075
1078 if (index_8bit == 255) {
1079 entry = &(pal[0]);
1080 } else {
1081 entry++;
1082 }
1083
1084
1085 uint8_t f1 = 255 - offset;
1089
1090
1091 uint8_t red2 = entry->red;
1092 uint8_t green2 = entry->green;
1093 uint8_t blue2 = entry->blue;
1098
1099
1100 red1 += red2;
1101 green1 += green2;
1102 blue1 += blue2;
1103 }
1105
1107 }
1108 return CRGB(red1, green1, blue1);
1109}
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)