Skip to content

Instantly share code, notes, and snippets.

@behreajj
Last active June 25, 2017 23:17
Show Gist options
  • Save behreajj/970dd09a04b9cb6ca17e0cc1db9e24d8 to your computer and use it in GitHub Desktop.
Save behreajj/970dd09a04b9cb6ca17e0cc1db9e24d8 to your computer and use it in GitHub Desktop.
Color Gradients 1-2
color red = color(255, 0, 0);
color blue = color(0, 0, 255);
int margin = 64;
int left = margin;
int top = margin;
int right = width - margin;
int bottom = height - margin;
size(512, 256);
background(255);
for (int i = top; i <= bottom; ++i) {
stroke(lerpColor(red, blue, (i - top) / float(bottom - top)));
line(left, i, right, i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment