fixed initialisation or random palette

This commit is contained in:
Damian Schneider 2024-01-27 22:03:29 +01:00
parent 12e2116acb
commit e114b842ba

View File

@ -78,7 +78,7 @@ uint16_t Segment::maxWidth = DEFAULT_LED_COUNT;
uint16_t Segment::maxHeight = 1;
CRGBPalette16 Segment::_randomPalette = generateRandomPalette(&_randomPalette);
CRGBPalette16 Segment::_newRandomPalette = CRGBPalette16(DEFAULT_COLOR);
CRGBPalette16 Segment::_newRandomPalette = generateRandomPalette(&_randomPalette);
unsigned long Segment::_lastPaletteChange = 0; // perhaps it should be per segment
#ifndef WLED_DISABLE_MODE_BLEND
@ -223,7 +223,6 @@ CRGBPalette16 IRAM_ATTR &Segment::loadPalette(CRGBPalette16 &targetPalette, uint
case 1: {//periodically replace palette with a random one
unsigned long timeSinceLastChange = millis() - _lastPaletteChange;
if (timeSinceLastChange > randomPaletteChangeTime * 1000U) {
//_randomPalette = _newRandomPalette;
_newRandomPalette = generateRandomPalette(&_randomPalette);
_lastPaletteChange = millis();
handleRandomPalette(); // do a 1st pass of blend