Skip to content

Commit ea231cb

Browse files
committed
Fixed "Flow Stripe" FX and added palette support
1 parent 00d1fcc commit ea231cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

wled00/FX.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4817,24 +4817,24 @@ static const char _data_FX_MODE_WAVESINS[] PROGMEM = "Wavesins@!,Brightness vari
48174817
//////////////////////////////
48184818
// Flow Stripe //
48194819
//////////////////////////////
4820-
// By: ldirko https://editor.soulmatelights.com/gallery/392-flow-led-stripe , modifed by: Andrew Tuline
4820+
// By: ldirko https://editor.soulmatelights.com/gallery/392-flow-led-stripe , modifed by: Andrew Tuline, fixed by @DedeHai
48214821
uint16_t mode_FlowStripe(void) {
48224822
if (SEGLEN <= 1) return mode_static();
48234823
const int hl = SEGLEN * 10 / 13;
48244824
uint8_t hue = strip.now / (SEGMENT.speed+1);
48254825
uint32_t t = strip.now / (SEGMENT.intensity/8+1);
48264826

48274827
for (unsigned i = 0; i < SEGLEN; i++) {
4828-
int c = (abs((int)i - hl) / hl) * 127;
4828+
int c = ((abs((int)i - hl) * 127) / hl);
48294829
c = sin8_t(c);
48304830
c = sin8_t(c / 2 + t);
48314831
byte b = sin8_t(c + t/8);
4832-
SEGMENT.setPixelColor(i, CHSV(b + hue, 255, 255));
4832+
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(b + hue, false, true, 3));
48334833
}
48344834

48354835
return FRAMETIME;
48364836
} // mode_FlowStripe()
4837-
static const char _data_FX_MODE_FLOWSTRIPE[] PROGMEM = "Flow Stripe@Hue speed,Effect speed;;";
4837+
static const char _data_FX_MODE_FLOWSTRIPE[] PROGMEM = "Flow Stripe@Hue speed,Effect speed;;!;pal=11";
48384838

48394839

48404840
#ifndef WLED_DISABLE_2D

0 commit comments

Comments
 (0)