From 27705ea5ddd4cdb3dd3f6a9db0bdcb6f48063725 Mon Sep 17 00:00:00 2001 From: Raphael Hunziker Date: Thu, 10 Sep 2026 21:42:42 +0200 Subject: [PATCH] ledstrip: fix one degree hue shift in the fixed colour layer applyLedFixedLayers() biases every hue by hOffset before taking the modulo, so the negative adjustments used by the battery, RSSI and throttle layers cannot push the hue below zero. That bias has to be a full turn, but it was HSV_HUE_MAX (359) instead of 360, so every LED handled by this layer came out one degree low. Colour 2 (red, hue 0) therefore reached the strip as hue 359, which hsvToRgb24() turns into R=255 G=0 B=4 instead of R=255 G=0 B=0 - the pink tint that was reported. The GPS layer writes its colour straight to the LED buffer without the offset, which is why the same red looks correct in GPS mode. With the full turn restored the battery and RSSI ramps again hit the colours listed in docs/LedStrip.md. Fixes #9633 --- src/main/io/ledstrip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/io/ledstrip.c b/src/main/io/ledstrip.c index 8e8e5771450..71e1e9bfca2 100644 --- a/src/main/io/ledstrip.c +++ b/src/main/io/ledstrip.c @@ -441,7 +441,7 @@ static void applyLedFixedLayers(void) hsvColor_t color = *getSC(LED_SCOLOR_BACKGROUND); int fn = ledGetFunction(ledConfig); - int hOffset = HSV_HUE_MAX; + int hOffset = HSV_HUE_MAX + 1; // a full turn, so that negative offsets below stay positive uint8_t channel = 0; switch (fn) {