diff --git a/lights.js b/lights.js index 7cd0509..a8045e3 100644 --- a/lights.js +++ b/lights.js @@ -77,6 +77,9 @@ function fade(index) { var current_tick = Math.floor((diff_cr / diff_r) * fade_ticks); + if (diff_r == 0 || diff_cr == 0) { + current_tick = fade_ticks; + } // console.log(`original: ${original.r} ${original.g} ${original.b}\n` + // `current: ${current.r} ${current.g} ${current.b}\n` + // `final: ${final.r} ${final.g} ${final.b}\n` +