522 {
523 if (blendType == LINEARBLEND_NOWRAP) {
524 index =
map8(index, 0, 247);
525
526 }
527
529#if defined(__AVR__)
530 hi5 /= 2;
531 hi5 /= 2;
532 hi5 /= 2;
533#else
534 hi5 >>= 3;
535#endif
536 fl::u8 lo3 = index & 0x07;
537
538
539
540
541
543
544 const CRGB *entry = (
CRGB *)((
fl::u8 *)(&(pal[0])) + hi5XsizeofCRGB);
545
547 fl::u8 green1 = entry->green;
548 fl::u8 blue1 = entry->blue;
549
551
553
554 if (hi5 == 31) {
555 entry = &(pal[0]);
556 } else {
557 ++entry;
558 }
559
562
566 red1 += red2;
567
568 fl::u8 green2 = entry->green;
571 green1 += green2;
572
573 fl::u8 blue2 = entry->blue;
576 blue1 += blue2;
577
579 }
580
584
585
586
587 if (red1) {
589#if !(FASTLED_SCALE8_FIXED == 1)
590 ++red1;
591#endif
592 }
593 if (green1) {
595#if !(FASTLED_SCALE8_FIXED == 1)
596 ++green1;
597#endif
598 }
599 if (blue1) {
601#if !(FASTLED_SCALE8_FIXED == 1)
602 ++blue1;
603#endif
604 }
606 } else {
607 red1 = 0;
608 green1 = 0;
609 blue1 = 0;
610 }
611 }
612
613 return CRGB(red1, green1, blue1);
614}
UISlider brightness("Brightness", 128, 0, 255, 1)
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
LIB8STATIC uint8_t map8(uint8_t in, uint8_t rangeStart, uint8_t rangeEnd)
Map from one full-range 8-bit value into a narrower range of 8-bit values, possibly a range of hues.
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.
Representation of an RGB pixel (Red, Green, Blue)