//Self Portrait
//Elizabeth Maday
function setup() {
createCanvas(600, 600);
background(220);
strokeWeight(5);
text("p5.js vers 0.7.1 test.", 10, 15);
}
function draw() {
background(252, 226, 97);
//caption
textSize(27);
textStyle(BOLD);
text("This is me.", 28, 238);
//body
var c = color(66, 148, 34);
fill(66, 148, 34);
ellipse(300, 600, 200, 600);
//ear left
var c = color(206, 141, 9);
fill(206, 141, 9);
ellipse(192, 270, 30, 40);
//ear right
var c = color(206, 141, 9);
fill(206, 141, 9);
ellipse(407, 270, 30, 40);
//head
fill(206, 141, 92); //this is the skin color
ellipse(300, 300, 220, 275);
//nose
arc(300, 325, 20, 20, 0, PI);
//right eye
var c = color(0, 0, 0);
fill(0, 0, 0);
ellipse(275, 245, 10, 10);
//left eye
ellipse(325, 245, 10, 10);
//hat
var c = color(255, 0, 0);
fill(255, 0, 0);
arc(300, 162, 40, 50, PI, TWO_PI);
//brim
var c = color(255, 0, 0);
fill(255, 0, 0);
ellipse(242, 161, 76, 10);
//earring
var c = color(0, 65, 251);
fill(0, 65, 251);
ellipse(415, 275, 10, 10);
//arms
line(395, 495, 470, 550);
line(470, 550, 550, 500);
line(208, 460, 125, 275);
//mouth
line(287, 372, 313 ,372);
//hands
var c = color(0, 0, 0);
fill(0, 0, 0);
ellipse(550, 500, 10, 10);
var c = color(0, 0, 0);
fill(0, 0, 0);
ellipse(125, 275, 10, 10);
//hair
var c = color(106, 66, 27);
fill(106, 66, 27);
triangle(280, 164, 318, 164, 298, 194);
var c = color(106, 66, 27);
fill(106, 66, 27);
triangle(240, 184, 280, 164, 267, 213);
var c = color(106, 66, 27);
fill(106, 66, 27);
triangle(318, 164, 360, 184, 333, 213);
//stripe
var c = color(0, 65, 251);
fill(0, 65, 251);
rect(210, 475, 180, 16);
}
In this project, I really enjoyed the creativity that was involved, as well as the challenge of figuring out how to produce what you want to see. This was one of my first times using code, and it really gave me an insight into the process. I am excited for the time when I will know how to realize more complicated ideas.