From ea231cbea8405c7b95f76491eb1b11a36e6214e8 Mon Sep 17 00:00:00 2001 From: Damian Schneider Date: Tue, 10 Jun 2025 19:29:53 +0200 Subject: [PATCH] Fixed "Flow Stripe" FX and added palette support --- wled00/FX.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index c76c9e6b9..13734b1a8 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -4817,7 +4817,7 @@ static const char _data_FX_MODE_WAVESINS[] PROGMEM = "Wavesins@!,Brightness vari ////////////////////////////// // Flow Stripe // ////////////////////////////// -// By: ldirko https://editor.soulmatelights.com/gallery/392-flow-led-stripe , modifed by: Andrew Tuline +// By: ldirko https://editor.soulmatelights.com/gallery/392-flow-led-stripe , modifed by: Andrew Tuline, fixed by @DedeHai uint16_t mode_FlowStripe(void) { if (SEGLEN <= 1) return mode_static(); const int hl = SEGLEN * 10 / 13; @@ -4825,16 +4825,16 @@ uint16_t mode_FlowStripe(void) { uint32_t t = strip.now / (SEGMENT.intensity/8+1); for (unsigned i = 0; i < SEGLEN; i++) { - int c = (abs((int)i - hl) / hl) * 127; + int c = ((abs((int)i - hl) * 127) / hl); c = sin8_t(c); c = sin8_t(c / 2 + t); byte b = sin8_t(c + t/8); - SEGMENT.setPixelColor(i, CHSV(b + hue, 255, 255)); + SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(b + hue, false, true, 3)); } return FRAMETIME; } // mode_FlowStripe() -static const char _data_FX_MODE_FLOWSTRIPE[] PROGMEM = "Flow Stripe@Hue speed,Effect speed;;"; +static const char _data_FX_MODE_FLOWSTRIPE[] PROGMEM = "Flow Stripe@Hue speed,Effect speed;;!;pal=11"; #ifndef WLED_DISABLE_2D