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 107 of file ease.cpp.hpp.

107 {
108 // ease-out is the inverse of ease-in: 1 - (1-t)²
109 // For 8-bit: y = MAX - (MAX-i)² / MAX
110 constexpr u16 MAX = 0xFF;
111 u32 d = MAX - i; // (MAX - i)
112 u32 num = d * d + (MAX >> 1); // (MAX-i)² + rounding
113 return u8(MAX - (num / MAX));
114}
#define MAX(a, b)
Definition coder.h:60
unsigned char u8
Definition stdint.h:131

References MAX.

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function: