Self portrait: Alexia Forsyth

Alexia Forsyth: javascript self-portrait

function setup() {
createCanvas(500, 300);
background(214, 90, 154);
text(“p5.js vers 0.9.0 test.”, 10, 15);
}

function draw() {
//hair
fill(122, 82, 43);
ellipse(width/2, 195, 200,350);

//braids
stroke(77, 51, 25);
line(300, 42, 270, 540);
stroke(77, 51, 25);
line(320, 67, 300, 540);
stroke(77, 51, 25);
line(340, 120, 310, 540);
stroke(77, 51, 25);
line(260, 20, 260, 540);
stroke(77, 51, 25);
line(200, 42, 250, 540);
stroke(77, 51, 25);
line(180, 67, 230, 540);
stroke(77, 51, 25);
line(160, 120, 200, 540);

//neck
fill(179, 141, 104);
rect(220, 265, 60, 100);

//face
fill(179, 141, 104);
ellipse(width/2, height/2, 150, 250);

//nose
ellipse(240, 170, 18,9);
ellipse(260, 170, 18,9);
rect(246,120,9,50);
fill(0);
ellipse(240,171,11,4);
fill(0);
ellipse(260,171,11,4);

//ears
fill(179, 141, 104);
ellipse(330,145,25,38);
fill(0);
circle(330,160, 7,7); //earrings 

fill(179, 141, 104);
ellipse(170,145,25,38);
fill(0);
circle(170,160, 7,7); //earrings




//eyes
fill(255);
ellipse(290,110,40,30);
fill(168, 131, 45);
circle(290,110,25);
fill(0);
circle(290,110,18);
stroke(0);
line(305, 99, 306,96);
line(300, 96, 301,94);
line(295, 95, 295,92);
line(290, 95, 290,92);
line(285, 95,284,93);
line(280, 96,279,93);

fill(255);
ellipse(215,110,40,30);
fill(168, 131, 45);
circle(215,110,25);
fill(0);
circle(215,110,18);
stroke(0);
line(230, 99, 231,96);
line(225, 96, 225,94);
line(220, 95, 220,92);
line(215, 95, 215,92);
line(210, 95,209,93);
line(205, 96,204,93);

//eyebrows
fill(77, 51, 25);
rect(270,87,40,3);

fill(77, 51, 25);
rect(200,87,40,3);

//lips
fill(171, 44, 68);
ellipse(width/2,220,55,35);
strokeWeight(5);
line(223, 220, 277, 220);
noLoop();

}

Leave a Reply