FastLED 3.9.15
Loading...
Searching...
No Matches

◆ easeOutQuad8()

u8 fl::easeOutQuad8 ( u8 i)

8-bit quadratic ease-out function Takes an input value 0-255 and returns an eased value 0-255 The curve starts fast and decelerates (ease-out only)

Definition at line 98 of file ease.cpp.

98 {
99 // ease-out is the inverse of ease-in: 1 - (1-t)²
100 // For 8-bit: y = MAX - (MAX-i)² / MAX
101 constexpr u16 MAX = 0xFF;
102 u32 d = MAX - i; // (MAX - i)
103 u32 num = d * d + (MAX >> 1); // (MAX-i)² + rounding
104 return u8(MAX - (num / MAX));
105}
#define MAX(a, b)
Definition math_macros.h:37
unsigned char u8
Definition int.h:17

References MAX.

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function: