Skip to content

Commit 684bf0b

Browse files
committed
random palette bugfix
if random palette was used in the startup preset, all LEDs were orange until the first palette cycling happened. This fix ensures that there is no all-orange palette initially.
1 parent c8b7ad7 commit 684bf0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wled00/FX_fcn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ void Segment::setUpLeds() {
271271
}
272272

273273
CRGBPalette16 &Segment::loadPalette(CRGBPalette16 &targetPalette, uint8_t pal) {
274-
static unsigned long _lastPaletteChange = 0; // perhaps it should be per segment
274+
static unsigned long _lastPaletteChange = millis() - 990000; // perhaps it should be per segment //WLEDMM changed init value to avoid pure orange after startup
275275
static CRGBPalette16 randomPalette = CRGBPalette16(DEFAULT_COLOR);
276276
static CRGBPalette16 prevRandomPalette = CRGBPalette16(CRGB(BLACK));
277277
byte tcp[76] = { 255 }; //WLEDMM: prevent out-of-range access in loadDynamicGradientPalette()

0 commit comments

Comments
 (0)