Skip to content

Instantly share code, notes, and snippets.

@behreajj
Last active June 27, 2017 14:11
Show Gist options
  • Save behreajj/3c080bee98e3ae06345ad8388068613e to your computer and use it in GitHub Desktop.
Save behreajj/3c080bee98e3ae06345ad8388068613e to your computer and use it in GitHub Desktop.
Color Gradients 1-5
color red = 0xffff0000;
color yellow = 0xffffff00;
float centerX = 256;
float centerY = 128;
float innerDiam = 32;
float outerDiam = 512;
size(512, 256);
background(255);
noStroke();
for (float i = outerDiam; i >= innerDiam; --i) {
fill(lerpColor(red, yellow,
(i - innerDiam) / (outerDiam - innerDiam)));
ellipse(centerX, centerY, i, i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment