Last active
September 30, 2017 21:26
-
-
Save bevchou/abfcc6bcc3072dbbbf16641be8163c02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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