change color swapping to be more concise

This commit is contained in:
Triplelexx 2017-03-11 07:40:32 +00:00
parent 8a0dd55275
commit 873a9aa39e

View file

@ -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