diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index f6ba28193c..cfa81690c3 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -1073,8 +1073,8 @@ void Segment::fade_out(uint8_t rate) const { uint8_t c1 = (color>>i); // get foreground channel // we can't use bitshift since we are using int int delta = (c2 - c1) * mappedRate / 256; - // if fade isn't complete, make sure delta is at least 1 (fixes rounding issues) - if (delta == 0) delta += (c2 == c1) ? 0 : (c2 > c1) ? 1 : -1; + // if integer scaling yields no progress, snap channel directly to target + if (delta == 0) c1 = c2; // stuff new value back into color color &= ~(0xFF<