Project 1 – Self Portrait

This is what I look like in code.

portrait
function setup() {
    createCanvas(600, 700);
    background(219, 246, 247);

}

function draw() {
    if(mouseX < 300 & mouseY < 350){
        background(180, 209, 211);
    }   else if (mouseX > 300 & mouseY < 350) {
        background(255, 231, 164);
    }  else if (mouseX < 300 & mouseY > 350){
        background(166, 126, 193);
    }   else {
        background(199, 71, 45);
    }

    noStroke();
    fill(0, 0, 2);  //hair
    ellipse(300, 400, 400, 600);

    fill(48, 82, 195);  //body
    ellipse(300, 700, 400, 600);

    fill(210, 170, 110);    //neck
    ellipse(300, 400, 200, 200);

    fill(0, 0, 0);  //hairline
    ellipse(300, 250, 300, 300);

    fill(235, 186, 123);    //skin
    ellipse(300, 300, 300, 350);

        fill(0, 0, 2);  //hairline
    ellipse(300, 250, 300, 300);

        fill(235, 186, 123);    //skin
    ellipse(300, 300, 250, 250);


    fill(0, 0, 0);      //eyes
    ellipse(230, 300, 40);
    ellipse(370, 300, 40);

    fill(255, 255, 255);
    ellipse(240, 290, 10);
    ellipse(380, 290, 10);

    fill(201, 153, 90);
    triangle(270, 370, 300, 300, 330, 370);     //nose

    fill(255, 150, 123);        //mouth
    arc(300, 400, 80, 80, TWO_PI, PI); 

    if (mouseIsPressed) {
        fill(235, 186, 123);      //eyes
    ellipse(230, 300, 50);
    ellipse(370, 300, 50);

    fill(0, 0, 0);
    rect(210, 300, 50, 5);
    rect(350, 300, 50, 5);

    }

    fill(46, 26, 2);
    rect(210, 250, 50, 10);
    rect(350, 250, 50, 10);

  

}

Leave a Reply