Project 1 : Self Portrait

sketchDownload
//Aadya Bhartia
//Section A
//Project 1 
function setup() {
    createCanvas(600, 600);
    background(220);
    text("p5.js vers 0.9.0 test.", 10, 15);
}

function draw() {
	background(40,200,200);
		if(mouseIsPressed){ //Background chnages colour if mouse is pressed 
			background(220,20,60);
		}
	//hair background 
    stroke(200,200,120);
    fill(0);
    ellipse(width/2,height/2.3,350,400);  
    //neck
    noStroke(); 
    fill(224,175,120);//fill tan colour 
    rect(252,350,90,80);   
    //face 
    noStroke(); 
    fill(236,180,120);//fill tan colour 
    ellipse(width/2,height/2.5,250,300);
    //hair fringe
    fill(0);
    arc(240,90,180,130,220,40);
    arc(342,93,180,130,120,60);
    ellipse(400,220,55,240);
    //eyes
    fill(0);
    ellipse(250,240,20); // black
    fill(0);
    ellipse(355,240,20); // black
    fill(255);
    ellipse(245,240,4); //white
    fill(255);
    ellipse(350,240,4); //white
    //cheeks
    fill(250,154,120,120); // chnaging opacity in 4th parameter
    ellipse(250,275,40,10);
    fill(250,154,120,120);
    ellipse(355,275,40,10);
    //nose
    noStroke(); 
    fill(185,130,70); 
    ellipse(305,285,40,17); 
    fill(236,180,120);
    ellipse(305,283,43,15);  
    //lips
    noStroke(); 
    fill(140,60,50); 
    ellipse(300,325,70,30); 
    fill(236,180,120);
    ellipse(300,317,76,17); 
    //glasses
    stroke(200,110,120);
    strokeWeight(3);
    noFill();
    ellipse(250,240,60); 
    ellipse(355,240,60); 
    arc(302,248,47,40,PI,TWO_PI);
    //earrings 
    fill(160,50,73);
    noStroke();
    ellipse(182,282,28);
    triangle(180,295,170,315,190,315);
    triangle(180,310,170,325,190,325);
    fill(150);
    ellipse(175,284,8); //white
}

Leave a Reply