Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setup() {
- createCanvas(900, 600);
- background(50, 100, 150);
- }
- function draw() {
- // no background statement here = more and more ellipses on the screen
- // select a random color
- fill(random(255), random(255), random(255));
- // add a 4th value to change the transparency
- // fill(random(255), random(255), random(255),150);
- // set stroke to white
- stroke(255);
- //set the width of the stroke to 2 pixels
- strokeWeight(2);
- // use noStroke() to remove the stroke
- // noStroke();
- // use noFill() to remove the surface fill
- // noFill();
- // drawing an ellipse at a random location
- ellipse(random(width), random(height), 50, 50);
- }
- function keyTyped() {
- // save screen as JPG image in the sketch folder
- // frameCount is the number of frames having been shown up to the point when you pressed a key
- save(frameCount + ".jpg");
- }
Add Comment
Please, Sign In to add comment