Processing.js sketch by Ian

Please upgrade your browser to something new like Google Chrome.

//Made with ProcessingLyon Tumblrify:
//http://p5lyon.tumblr.com/ProcessingJSTumblr
//English Version:
//http://p5lyon.tumblr.com/ProcessingJSTumblrEn

int i = 0;

void setup() {
size(400, 400);
background(10, 80, 100);
rectMode(CENTER);
}

void draw() {

if (keyPressed) {
background(10, 80, 100);
}

if (mousePressed) {
stroke(0);
fill(mouseY/255, mouseY, mouseX, 20);
rect(width/2, height/2, mouseX, mouseY, mouseX);

stroke(0);
fill(mouseY, mouseX, mouseX/255, 20);
rect(width/2, height/2, mouseY, mouseX, mouseY);
}

else{
stroke(0);
fill(mouseY, mouseX, mouseX/255, 20);
ellipse (width/2, height/2, mouseX, mouseX);

stroke(0);
fill(mouseX, mouseY/255, mouseY, 20);
ellipse (width/2, height/2, mouseY, mouseY);
}

}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.