525 {
526
527 float smooth_t =
t *
t * (3.0f - 2.0f *
t);
528
529
530 float brightness_a = (a.r + a.g + a.b) / 765.0f;
531 float brightness_b = (b.r + b.g + b.b) / 765.0f;
532 float target_brightness = brightness_a + (brightness_b - brightness_a) * smooth_t;
533
534 CRGB result = CRGB(
535 a.r + (int)((b.r - a.r) * smooth_t),
536 a.g + (int)((b.g - a.g) * smooth_t),
537 a.b + (int)((b.b - a.b) * smooth_t)
538 );
539
540
544 compensation = min(compensation, 2.0f);
545 result.r = min(255, (int)(result.r * compensation));
546 result.g = min(255, (int)(result.g * compensation));
547 result.b = min(255, (int)(result.b * compensation));
548 }
549
550 return result;
551 }