MCPcopy Create free account
hub / github.com/FastLED/FastLED / easeOutQuad8

Function easeOutQuad8

src/fl/math/ease.cpp.hpp:107–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107u8 easeOutQuad8(u8 i) {
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}
115
116u8 easeInCubic8(u8 i) {
117 // Simple cubic ease-in: i³ scaled to 8-bit range

Callers 1

ease8Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected