FastLED 3.10.6
Loading...
Searching...
No Matches

◆ fromBrightness()

FluxScalar fl::FluxScalar::fromBrightness ( u8 brightness)
static

setBrightness(b) as the linear flux scalar b/255.

255 is exactly unity, so full brightness cannot dim the output by a rounding step.

Definition at line 17 of file flux_scalar.cpp.hpp.

17 {
18 // Round to nearest so mid brightnesses are not biased low. 255 lands on
19 // exactly 65536: 255 * 65536 / 255.
20 const u32 raw = (static_cast<u32>(brightness) * 65536u + 127u) / 255u;
21 return FluxScalar(static_cast<i32>(raw));
22}
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
FluxScalar(i32 raw) FL_NO_EXCEPT

References FluxScalar(), brightness, and fl::FL_NO_EXCEPT.

Referenced by fl::ColorManagedPixelSource::setFlux().

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