function setup() {
createCanvas(455, 430);
background(255, 87, 51);
}
function draw() {
//face
fill(255, 195, 1);
noStroke();
rect(120, 130, 80, 200);
stroke(225, 195, 15);
strokeWeight(1)
rect(160, 128, 100, 180, 50);
//nose
triangle(257, 216, 257, 246, 275, 246);
//sunglasses
stroke(90, 24, 70);
strokeWeight(5);
line(170, 200, 260, 200);
fill(145, 13, 63);
ellipse(230, 210, 37);
//lips
stroke(145, 13, 63);
strokeWeight(1);
fill(199, 0, 57);
triangle(245, 270, 260, 270, 260, 260);
triangle(245, 270, 260, 270, 260, 280);
//hair
noStroke();
fill(145, 13, 63);
triangle(100, 130, 270, 85, 270, 160);
fill(125, 13, 63);
triangle(100, 130, 150, 137, 100, 300);
fill(105, 23, 63);
rect(80, 130, 60, 230);
fill(145, 23, 63);
triangle(40, 350, 140, 350, 120, 130);
fill(135, 13, 63);
triangle(150, 130, 180, 140, 130, 210);
//headphones
fill(90, 24, 70);
ellipse(170, 215, 55);
fill(199, 0, 57);
ellipse(175, 210, 55);
quad(195, 105, 235, 95, 190, 200, 160, 200);
}
In this project I started by hand sketching the portrait I wanted to create, and then broke it up into primitive shapes. Creating this image using JS required a number of iterations much greater than I expected, moving shapes around until I formed the full image I had in mind.