diff --git a/light/Light.cpp b/light/Light.cpp index a9b58f4..44507f4 100644 --- a/light/Light.cpp +++ b/light/Light.cpp @@ -74,7 +74,7 @@ static uint32_t getBrightness(const LightState& state) { } static inline uint32_t scaleBrightness(uint32_t brightness, uint32_t maxBrightness) { - return brightness * maxBrightness / 0xFF; + return (brightness - 1) * (maxBrightness - 1) / (0xFF - 1) + 1; } static inline uint32_t getScaledBrightness(const LightState& state, uint32_t maxBrightness) {