diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 4d08bc144..075988cd5 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -964,7 +964,7 @@ uint32_t WS2812FX::color_from_palette(uint16_t i, bool mapping, bool wrap, uint8 } uint8_t paletteIndex = i; - if (mapping) paletteIndex = (i*255)/(SEGLEN -1); + if (mapping && SEGLEN > 1) paletteIndex = (i*255)/(SEGLEN -1); if (!wrap) paletteIndex = scale8(paletteIndex, 240); //cut off blend at palette "end" CRGB fastled_col; fastled_col = ColorFromPalette( currentPalette, paletteIndex, pbri, (paletteBlend == 3)? NOBLEND:LINEARBLEND);