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

Function coordToU8

src/fl/gfx/primitives.h:24–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22/// Generic: for fixed-point types (those with .to_int())
23template<typename T>
24inline fl::u8 coordToU8(T alpha) {
25 return (fl::u8)fl::clamp((alpha * T(255.0f) + T(0.5f)).to_int(), 0, 255);
26}
27
28// Specialization for float
29template<>

Callers

nothing calls this directly

Calls 3

clampFunction · 0.85
TEnum · 0.85
to_intMethod · 0.45

Tested by

no test coverage detected