Skip to content

Instantly share code, notes, and snippets.

@m0wh
Created March 8, 2018 10:57
Show Gist options
  • Save m0wh/e6b13eb7922b72a8d1ceb37a54fcede7 to your computer and use it in GitHub Desktop.
Save m0wh/e6b13eb7922b72a8d1ceb37a54fcede7 to your computer and use it in GitHub Desktop.
Color processing experiment
float r;
float v;
float b;
int a = 5;
void setup() {
size(800,800);
pixelDensity(2); // if retina display
}
void draw() {
r = random(255);
v = random(255);
b = random(255);
colorMode(RGB);
for(int i = 0; i <= 800; i++) {
if(r > 225) {r = 10;}
if(r < 0) {r = 250;}
r+=random(-a,a);
v+=random(-a,a);
if(v >= 225) {v = 150;}
if(v < 150) {v = 255;}
b+=random(-a,a);
if(b >= 225) {b = 100;}
if(b < 100) {b = 255;}
stroke(r,v,b);
line(0,i,800,i);
}
noLoop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment