Skip to content

Instantly share code, notes, and snippets.

@bevchou
Last active September 30, 2017 21:26
Show Gist options
  • Save bevchou/abfcc6bcc3072dbbbf16641be8163c02 to your computer and use it in GitHub Desktop.
Save bevchou/abfcc6bcc3072dbbbf16641be8163c02 to your computer and use it in GitHub Desktop.
function setup() {
createCanvas(400, 600);
numLayers = 50;
layerHeight = height/numLayers;
startCol = color(177, 233, 239);
endCol = color(26, 33, 68);
colIncr = 1/numLayers;
}
function draw() {
noStroke();
for (let i = 0; i < numLayers; i++){
let waterCol = lerpColor(startCol, endCol, colIncr*i);
fill(waterCol);
rect(0, layerHeight*i, width, layerHeight);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment