rnayyar self-portrait

click on me and I blink!

rhea portraitSimple p5.js Template


//Rhea Nayyar
//Section C (Tuesdays 1:30)
//rnayyar
//Self-Portrait

function setup() {
    createCanvas(600, 600);

}

function draw(){
  background(193, 85, 174);
  fill(0);
  quad(160,155,350,170,395,470,145,470); //hair foundation
  fill(178, 138, 123); //neck color
  strokeWeight(0);
  rect(190,350,120,150); //neck
  ellipseMode(CORNERS);
  fill(202, 144, 104); //skin color
  strokeWeight(0);
  ellipse(150,150,350,450); //face
  fill(202, 144, 104);
  quad(180,400,324,400,265,465,235,465); //chin and jaw line
  ellipseMode(CORNERS);
  fill(217, 161, 113); //nose color
  ellipse(233,295,270,380); //nose bridge
  ellipse(230,350,273,374); //nostrils
  fill(172, 119, 115); //bottom lip color
  quad(223,415,285,415,265,430,245,430); //bottom lip
  fill(144, 83, 79); //top lip color
  quad(223,415,256,415,250,402,247,402); //top lips and cupid's bow
  quad(250,415,285,415,262,402,258,402);
  fill('black'); //regular eyes eyelashes
  ellipse(179,295,227,310); //eyelash
  ellipse(273,295,322,310); //eyelash
  fill(176, 136, 100); //eyelid color
  ellipse(235,258,270,275); //lid 1
  ellipse(245,263,267,271); //lid 2
  if (mouseIsPressed) { //blinking
    fill(0);
    ellipse(233,270,272,257); //third eye upper lashes
    fill(225);
    ellipse(235,258,270,275); //third eye
    fill(144, 106, 45);
    ellipse(245,260,260,272); //third eye iris

  } else {
    fill(0); //lower lash line 3rd eye
    ellipse(233,263,272,277);
    fill(176, 136, 100);
    ellipse(235,258,270,275); //third eye lid

}

  fill(0); //hair color
  ellipse(179,295,227,310); //eyelash
  ellipse(273,295,322,310); //eyelash
  quad(190,190,344,235,328,175,195,145); //quads are hair and eyebrows
  quad(175,165,360,310,335,160,225,140);
  quad(175,156,165,350,130,250,160,160);
  quad(350,165,365,178,400,190,350,430);
  quad(350,450,400,415,420,540,365,520);
  quad(140,400,175,430,200,520,130,530);
  quad(115,350,150,250,170,450,105,420);
  quad(100,250,200,160,150,400,145,460);
  quad(180,287,222,283,218,272,185,281);
  quad(287,272,322,287,318,281,285,285);
  quad(285,250,360,275,420,350,400,400);
  fill(176, 136, 100); //eyelid color
  ellipse(180,290,225,308); //eyelids
  ellipse(275,290,320,308);


}

Leave a Reply