Skip to content

Instantly share code, notes, and snippets.

@jonesfish
Last active October 15, 2015 15:07
Show Gist options
  • Select an option

  • Save jonesfish/13d6894dc66a040ed112 to your computer and use it in GitHub Desktop.

Select an option

Save jonesfish/13d6894dc66a040ed112 to your computer and use it in GitHub Desktop.
void setup(){
size(400,300);
colorMode(HSB);
}
// repeat all the time --> refresh the screen continuously
void draw(){
background(0);
float spacing = 20;
for (float x=0; x < mouseX; x+=spacing){
float hue = x/width * 255;
noStroke();
fill(hue, 255, 255);
rect(x,0,spacing,height);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment