Last active
June 25, 2017 23:17
-
-
Save behreajj/970dd09a04b9cb6ca17e0cc1db9e24d8 to your computer and use it in GitHub Desktop.
Color Gradients 1-2
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 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