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

◆ time_alpha8()

u8 fl::time_alpha8 ( u32 now,
u32 start,
u32 end )

Definition at line 8 of file time_alpha.cpp.

8 {
9 if (now < start) {
10 return 0;
11 }
12 if (now > end) {
13 return 255;
14 }
15 u32 elapsed = now - start;
16 u32 total = end - start;
17 u32 out = (elapsed * 255) / total;
18 if (out > 255) {
19 out = 255;
20 }
21 return static_cast<u8>(out);
22}
unsigned char u8
Definition int.h:17
constexpr T * end(T(&array)[N]) noexcept

References end().

Referenced by fl::TimeClampedTransition::update8(), and fl::TimeRamp::update8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: