Last active
December 31, 2015 02:19
-
-
Save Usse/7920347 to your computer and use it in GitHub Desktop.
Processing Random colour and dimension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
size(480,120); | |
} | |
void draw() { | |
int[] colours = {255, 100, 10}; | |
if(mousePressed) { | |
fill(0); | |
}else { | |
//fill(255); | |
int index = int(random(colours.length)); | |
fill(colours[index]); | |
} | |
float random = random(50) + 30; | |
ellipse(mouseX, mouseY,random,random); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment