Created
June 20, 2020 21:34
-
-
Save lsei/9e47431eb5e76d6f51be2bec56d29b89 to your computer and use it in GitHub Desktop.
This file contains hidden or 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(windowWidth, windowHeight); | |
} | |
function draw() { | |
background(214, 213, 210); | |
translate(windowWidth / 2, windowHeight / 2); | |
scale(1.5); | |
circGradient(0, 0, 800, 1000, color(46, 31, 50), color(214, 213, 210)); | |
circGradient(0, 0, 600, 800, color(27, 20, 25), color(46, 31, 50)); | |
circGradient(0, 0, 590, 600, color(214, 213, 210), color(27, 20, 25)); | |
circGradient(noise(millis() / 1000) * 0, noise(millis() / 1000) * 0, 300, 590, color(46, 31, 50), color(214, 213, 210)); | |
circGradient(noise(millis() / 1000 + 0) * 0, noise(millis() / 1000 + 0) * 0, 0, 300, color(27, 20, 25), color(46, 31, 50)); | |
} | |
function circGradient(x, y, rInner, rOuter, cInner, cOuter) { | |
push(); | |
strokeWeight(2); | |
noFill(); | |
for (let r = rOuter; r >= rInner; r--) { | |
let c = lerpColor(cInner, cOuter, (r - rInner) / (rOuter - rInner)); | |
stroke(c); | |
circle(x, y, r / 2); | |
} | |
pop(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment