Project 1: My Self Portrait

Self-Portrait Code

function setup() {
    createCanvas(600, 700);
    background(245);
}
function draw() {
//hair
     strokeWeight(0);
    fill(226, 194, 121);
    ellipse(300, 230, 310, 285);
    rect(145, 230, 310, 500);    
//head
    fill(245, 224, 204);
    ellipse(300, 290, 290, 340);
//cheeks
    fill(238, 158, 158);
    ellipse(225, 300, 80, 43);
    ellipse(375, 300, 80, 43);
//nose
   fill(245, 189, 173);
   circle(300, 310, 30);
   fill(245, 224, 204);
   rect(270, 280, 60, 30);
//eyes
    noFill();
    strokeWeight(5);
    stroke(100)
    arc(230, 255, 55, 30, PI, 0);
    arc(370, 255, 55, 30, PI, 0);
//mouth
    arc(300, 370, 45, 30, 0, PI);
    strokeWeight(0);
//shirt
    //(how the cords of quad ordered) top left, top right, bottom right, bottom left
    fill(187, 209, 153);
    quad(90, 540, 250, 510, 250, height, 90, height);
    rect(250, 510, 100, 240);
    quad(350, 510, 510, 540, 510, height, 350, height);
//neck
    fill(245, 224, 204);
    rect(250, 440, 100, 70);
    circle(300, 500, 100);
}

What was most challenging was just planning out the drawing and deciding what coordinates I wanted and how I wanted to approach the code.

Leave a Reply