Skip to content

Instantly share code, notes, and snippets.

@animanoir
Created September 30, 2019 04:12
Show Gist options
  • Save animanoir/97d7ca5175060f5dd0016a25ae776b19 to your computer and use it in GitHub Desktop.
Save animanoir/97d7ca5175060f5dd0016a25ae776b19 to your computer and use it in GitHub Desktop.
int w = 500;
int h = 500;
int r, g;
void setup() {
size(500, 555);
noStroke();
background(255);
}
void draw() {
r = (int)map(mouseX, 0, width, 0, 255);
g = (int)map(mouseY, 0, width, 0, 255);
println("Valor de mouseX = "+mouseX);
println("Valor de r = "+r);
fill(r, g, 128, 128);
ellipse(mouseX, mouseY, g, g);
}
void mouseReleased(){
saveFrame("JPG.jpg");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment