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

◆ time_alpha8()

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

Definition at line 9 of file time_alpha.cpp.hpp.

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

References end(), and FL_NOEXCEPT.

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: