Skip to content

Commit 728b1e8

Browse files
authored
Merge pull request wled#4723 from DedeHai/Flow_Stripe_FX_fix
Fixed "Flow Stripe" FX and added palette support
2 parents a50b4f5 + ea231cb commit 728b1e8

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
@@ -4818,24 +4818,24 @@ static const char _data_FX_MODE_WAVESINS[] PROGMEM = "Wavesins@!,Brightness vari
48184818
//////////////////////////////
48194819
// Flow Stripe //
48204820
//////////////////////////////
4821-
// By: ldirko https://editor.soulmatelights.com/gallery/392-flow-led-stripe , modifed by: Andrew Tuline
4821+
// By: ldirko https://editor.soulmatelights.com/gallery/392-flow-led-stripe , modifed by: Andrew Tuline, fixed by @DedeHai
48224822
uint16_t mode_FlowStripe(void) {
48234823
if (SEGLEN <= 1) return mode_static();
48244824
const int hl = SEGLEN * 10 / 13;
48254825
uint8_t hue = strip.now / (SEGMENT.speed+1);
48264826
uint32_t t = strip.now / (SEGMENT.intensity/8+1);
48274827

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

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

48404840

48414841
#ifndef WLED_DISABLE_2D

0 commit comments

Comments
 (0)