From 873a9aa39ec0f5b8ceb85a3641b84adc2acfa9de Mon Sep 17 00:00:00 2001 From: Triplelexx Date: Sat, 11 Mar 2017 07:40:32 +0000 Subject: [PATCH] change color swapping to be more concise --- scripts/system/audioMuteOverlay.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/scripts/system/audioMuteOverlay.js b/scripts/system/audioMuteOverlay.js index 8ffa1655b7..973faa57a8 100644 --- a/scripts/system/audioMuteOverlay.js +++ b/scripts/system/audioMuteOverlay.js @@ -79,15 +79,11 @@ } else { // after tween completion reset to zero and flip values to ping pong tweenPosition = 0; - var buf = startColor.red; - startColor.red = endColor.red; - endColor.red = buf; - buf = startColor.green; - startColor.green = endColor.green; - endColor.green = buf; - buf = startColor.blue; - startColor.blue = endColor.blue; - endColor.blue = buf; + for (var color in startColor) { + var storedColor = startColor[color]; + startColor[color] = endColor[color]; + endColor[color] = storedColor; + } } // update position based on LERP_AMOUNT