Skip to content

Instantly share code, notes, and snippets.

@jacopocolo
Last active June 27, 2018 06:57
Show Gist options
  • Save jacopocolo/8366ed0391988479ba9cecf5a12818a7 to your computer and use it in GitHub Desktop.
Save jacopocolo/8366ed0391988479ba9cecf5a12818a7 to your computer and use it in GitHub Desktop.
function setup() {
createCanvas(200, 200) //set up a 200x200 px artboard
background("#FFFFFF")
}
function draw() {
symbol('rect',0,0);
fill("#f0a90f")
stroke("#98678f")
rect(0,0,width/4,height/4)
push()
translate(75,0);
arc(0,0, 50, 50, HALF_PI, PI)
pop()
push()
translate(100,0);
ellipse(0,0,50,50)
pop()
push()
translate(125,0);
line(0,0,50,50)
point(50,0)
pop();
push();
translate(150,0);
quad(0, 0, 50, 0, 50, 50, 0, 50);
pop();
push();
translate(0,50);
triangle(0, 0, 50, 50, 0, 50);
pop();
push();
translate(50,50);
strokeCap(ROUND);
strokeJoin(ROUND);
strokeWeight(4);
bezier(0, 0, 25, 50, 50, 50, 0, 50);
pop();
push();
translate(75,50);
beginShape();
vertex(0, 0);
vertex(30, 20);
bezierVertex(25, 50, 50, 50, 0, 50);
vertex(0, 0);
endShape();
pop();
push();
translate(0, 100);
textSize(26);
textFont("Georgia")
text("Lorem ipsum",0,0,100,100);
pop();
push();
translate(125, 75);
rotate(PI/4);
rect(0,0,25,25);
pop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment