Created
June 25, 2017 17:21
-
-
Save behreajj/a1da77d9ebbb693bf7e37b918f014f57 to your computer and use it in GitHub Desktop.
Color Gradients 2-7
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
Gradient grad; | |
float fw; | |
void setup() { | |
size(1024, 128); | |
fw = float(width); | |
grad = new Gradient( | |
new ColorStop(0.75, 0xffff007f), | |
new ColorStop(0.333, 0xff7f00ff), | |
new ColorStop(0.5, 0xff00ff00), | |
new ColorStop(0.125, 0xffff7f00), | |
new ColorStop(1, 0xff3fff7f)); | |
} | |
void draw() { | |
for (int i = 0; i <= width; ++i) { | |
stroke(grad.evaluate(i / fw)); | |
line(i, 0, i, height); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment