为什么这行得通,
var color = Math.sin( time ) * 128;
color = 128;
context.fillStyle = "rgb(" + color + ", " + color + ", " + color + ")";
但这不?
var color = Math.sin( time ) * 128;
color += 128;
context.fillStyle = "rgb(" + color + ", " + color + ", " + color + ")";
由于某种原因,变量一旦变为动态就会停止工作。