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

Method value_normalized

src/fl/ui/slider.h:71–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69 float max = 255, float step = -1.f) FL_NOEXCEPT;
70 float value() const FL_NOEXCEPT { return mImpl.value(); }
71 float value_normalized() const FL_NOEXCEPT {
72 float min = mImpl.getMin();
73 float max = mImpl.getMax();
74 if (fl::almost_equal(max, min, 0.0001f)) {
75 return 0;
76 }
77 return (value() - min) / (max - min);
78 }
79 float getMax() const FL_NOEXCEPT { return mImpl.getMax(); }
80 float getMin() const FL_NOEXCEPT { return mImpl.getMin(); }
81 void setValue(float value) FL_NOEXCEPT;

Callers

nothing calls this directly

Calls 4

almost_equalFunction · 0.85
valueFunction · 0.50
getMinMethod · 0.45
getMaxMethod · 0.45

Tested by

no test coverage detected