Last active
June 25, 2017 23:23
-
-
Save behreajj/2a88f3b1a295cade0c3f7245552ebc5d to your computer and use it in GitHub Desktop.
Color Gradients 1-6
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
color green = 0x3f00ff00; | |
color red = 0x3fff0000; | |
float centerXStart = 256; | |
float centerYStart = 128; | |
float centerXStop = 128; | |
float centerYStop = 64; | |
float innerDiam = 32; | |
float outerDiam = 512; | |
float detail = 30; | |
size(512, 256); | |
noStroke(); | |
background(0xffffffff); | |
for (float i = outerDiam, step; i >= innerDiam; i -= detail) { | |
step = (i - innerDiam) / (outerDiam - innerDiam); | |
fill(lerpColor(green, red, step)); | |
ellipse(lerp(centerXStart, centerXStop, step), | |
lerp(centerYStart, centerYStop, step), i, i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment