21 uint8_t maxBrightness,
float lowThreshold,
22 float highThreshold) {
23 float maxBrightnessPercent = (maxBrightness / 255.0f) * 100.0f;
24 if (inputBrightnessPercent < lowThreshold) {
26 }
else if (inputBrightnessPercent < highThreshold) {
27 float range = highThreshold - lowThreshold;
28 float progress = (inputBrightnessPercent - lowThreshold) / range;
30 100.0f - (progress * (100.0f - maxBrightnessPercent));
31 return static_cast<uint8_t>((targetPercent / 100.0f) * 255.0f);