Project 1: Self Portrait

An abstract version of myself.

portrait
function setup() {
    createCanvas(400, 400);
    text("p5.js vers 0.9.0 test.", 10, 15);
}

function draw() {
	 background(204, 245, 255);
  //left ear
  fill(250, 168, 69);
  stroke(0);
  strokeWeight(3);
  triangle(117, 167, 103, 208, 122, 226);
  //main circle
  fill(252, 219, 190);
  stroke(0);
  strokeWeight(3);
  ellipse(198, 171, 177, 177);
  //green triangle
  fill(148, 206, 146);
  strokeWeight(3);
  triangle(285, 199, 266, 277, 201, 314);
  //pink triangle
  fill(232, 172, 206);
  strokeWeight(3);
  triangle(117, 202, 136, 280, 201, 317);
  //right eye
  fill(108, 145, 191);
  stroke(250);
  strokeWeight(3);
  ellipse(240, 183, 21, 21);
  fill(0)
  noStroke();
  ellipse(240, 183, 11, 11);
  //left eye
  fill(250);
  stroke(0);
  strokeWeight(3);
  ellipse(164, 183, 21, 21);
  fill(0);
  noStroke();
  ellipse(164, 183, 11, 11);
  //middle face
  fill(228, 190, 152);
  stroke(0);
  strokeWeight(3);
  triangle(136, 231, 268, 239, 201, 314);
  //nose
  fill(229, 204, 181);
  triangle(199, 193, 190, 229, 205, 246);
  //lips
  fill(216, 114, 100);
  triangle(174, 264, 187, 256, 202, 264);
  triangle(201, 264, 215, 256, 229, 264);
  fill(238, 171, 163);
  triangle(174, 264, 202, 283, 229, 264);
  //right ear
  fill(241, 238, 141);
  triangle(287, 170, 297, 211, 279, 230);
  //brows
  noFill();
  line(228, 167, 250, 167);
  line(150, 167, 172, 167); 
  //right hair
  stroke(0);
  strokeWeight(3);
  noFill();
  bezier(190, 85, 200, 80, 170, 160, 280, 165);
  bezier(200, 85, 220, 100, 180, 155, 280, 160);
  bezier(215, 85, 230, 90, 190, 150, 280, 157);
  bezier(220, 85, 240, 85, 200, 145, 285, 153);
  bezier(240, 100, 250, 60, 210, 140, 300, 147);
  bezier(175, 84, 150, 100, 200, 160, 86, 166);
  bezier(172, 80, 140, 90, 190, 155, 86, 160);
  bezier(160, 100, 130, 80, 180, 150, 86, 155);
  bezier(150, 115, 120, 70, 170, 145, 86, 150);
}

Leave a Reply