567 {
568
569 fl::u8 index_4bit = index >> 12;
570
572
573 const CRGB *entry = &(pal[0]) + index_4bit;
575 fl::u8 green1 = entry->green;
576 fl::u8 blue1 = entry->blue;
577
580 if (index_4bit == 15) {
581 entry = &(pal[0]);
582 } else {
583 entry++;
584 }
585
586
587
589 red1 = scale8_LEAVING_R1_DIRTY(red1, f1);
590 green1 = scale8_LEAVING_R1_DIRTY(green1, f1);
591 blue1 = scale8_LEAVING_R1_DIRTY(blue1, f1);
592
593
595 fl::u8 green2 = entry->green;
596 fl::u8 blue2 = entry->blue;
597 red2 = scale8_LEAVING_R1_DIRTY(red2,
offset);
598 green2 = scale8_LEAVING_R1_DIRTY(green2,
offset);
599 blue2 = scale8_LEAVING_R1_DIRTY(blue2,
offset);
600 cleanup_R1();
601
602
603 red1 += red2;
604 green1 += green2;
605 blue1 += blue2;
606 }
608
610 }
611 return CRGB(red1, green1, blue1);
612}
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
fl::UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
Representation of an 8-bit RGB pixel (Red, Green, Blue)