Skip to content

Instantly share code, notes, and snippets.

@behreajj
Created June 25, 2017 17:21
Show Gist options
  • Save behreajj/a1da77d9ebbb693bf7e37b918f014f57 to your computer and use it in GitHub Desktop.
Save behreajj/a1da77d9ebbb693bf7e37b918f014f57 to your computer and use it in GitHub Desktop.
Color Gradients 2-7
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