mirror of
https://github.com/wled/WLED.git
synced 2025-04-23 22:37:18 +00:00
fixed initialisation or random palette
This commit is contained in:
parent
12e2116acb
commit
e114b842ba
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user