Skip to content

Instantly share code, notes, and snippets.

@behreajj
Last active June 25, 2017 23:23
Show Gist options
  • Save behreajj/2a88f3b1a295cade0c3f7245552ebc5d to your computer and use it in GitHub Desktop.
Save behreajj/2a88f3b1a295cade0c3f7245552ebc5d to your computer and use it in GitHub Desktop.
Color Gradients 1-6
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