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

◆ time_alpha8()

uint8_t fl::time_alpha8 ( uint32_t now,
uint32_t start,
uint32_t 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 uint32_t elapsed = now - start;
16 uint32_t total = end - start;
17 uint32_t out = (elapsed * 255) / total;
18 if (out > 255) {
19 out = 255;
20 }
21 return static_cast<uint8_t>(out);
22}

Referenced by fl::TimeLinear::update(), and fl::TimeRamp::update().

+ Here is the caller graph for this function: