FastLED
3.9.15
Loading...
Searching...
No Matches
◆
ease16InOutCubic()
LIB8STATIC
fl::u16 ease16InOutCubic
(
fl::u16
i
)
Definition at line
549
of file
lib8tion.h
.
549
{
550
// This function produces wrong results, use fl::easeInOutCubic16 instead
551
//
552
// 16-bit cubic ease-in / ease-out function
553
// Equivalent to ease8InOutCubic() but for 16-bit values
554
// Formula: 3(x^2) - 2(x^3) applied with proper ease-in-out curve
555
556
// Apply the cubic formula directly, similar to the 8-bit version
557
// scale16(a, b) computes (a * b) / 65536
558
fl::u32 ii = scale16(i, i);
// i^2 scaled to 16-bit
559
fl::u32 iii = scale16(ii, i);
// i^3 scaled to 16-bit
560
561
// Apply cubic formula: 3x^2 - 2x^3
562
fl::u32 r1 = (3 * ii) - (2 * iii);
563
564
// Clamp result to 16-bit range
565
if
(r1 > 65535) {
566
return
65535;
567
}
568
return
(fl::u16)r1;
569
}
References
LIB8STATIC
.
Easing Functions
Generated on Tue Jun 16 2026 00:07:02 for FastLED by
1.13.2