[WUT] Adam I've been wondering the exact same thing. Game Lab hates long for
loops so the frame rate will plummet for gradients like this.
There is a workaround though with using larger shapes and smaller loops. Here's an example from KA that I got working in Game Lab:
var horizon = 290;
var sky1 = rgb(0, 0, 100);
var sky2 = rgb(150, 0, 70);
function draw() {
background(rgb(255, 255, 255));
for (var y = 0 ; y < horizon ; y+=4) {
noStroke();
fill(lerpColor(sky1, sky2, y / horizon));
rect(0, y, 400, 4);
}
text("FPS: " + Math.round(World.frameRate), 0, 15); // 30 frames per second!
}
This program uses larger shapes to reduce the number of loops, and that seems to fix any lag issues.