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

Function time_alphaf

src/fl/math/time_alpha.h:25–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23u16 time_alpha16(u32 now, u32 start, u32 end) FL_NOEXCEPT;
24
25inline float time_alphaf(u32 now, u32 start, u32 end) FL_NOEXCEPT {
26 if (now < start) {
27 return 0.0f;
28 }
29 u32 elapsed = now - start;
30 u32 total = end - start;
31 float out = static_cast<float>(elapsed) / static_cast<float>(total);
32 return out;
33}
34
35class TimeAlpha {
36 public:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected