xxxxxxxxxx
71
/*
self portrait v1
by owen roberts
9/12/2022
*/
function setup() {
createCanvas(400, 600);
background("#FFC300"); // hex value as string with ''
// head
rectMode(CENTER);
noStroke();
fill(185, 128, 185); // light purple
rect(200, 300, 300, 400, 40);
// eyes
fill(255); // 255 is highest value
circle(200 + 65, 310 - 50, 50);
circle(200 - 65, 310 - 50, 50);
// glasses lens
noStroke();
fill(173, 216, 230, 100); // light blue -- 4th number is transparency
circle(200 + 80, 300 - 50, 100);
circle(200 - 80, 300 - 50, 100);
// glasses frames
stroke(50);
strokeWeight(10);
noFill();
circle(200 + 80, 300 - 50, 100);
circle(200 - 80, 300 - 50, 100);
// computer screen
fill(50);
beginShape();
vertex(20, 400);
vertex(400 - 20, 400);
vertex(400 - 40, 600);
vertex(40, 600);
endShape(CLOSE);
// computer logo
fill('plum');
noStroke();
rect(200 - 11, 500, 20);
rect(200 + 11, 500, 20);
rect(200 - 11, 521, 20);
rect(200 + 11, 521, 20);
// hair
stroke(50);
line(100, 80, 120, 120);
line(100 + 40, 80, 120 + 40, 120);
line(100 + 80, 80, 120 + 80, 120);
line(100 + 40 * 3, 80, 120 + 40 * 3, 120);
line(100 + 40 * 4, 80, 120 + 40 * 4, 120);
// curly hair
noFill();
beginShape();
curveVertex(500, 500);
curveVertex(120, 120);
curveVertex(60, 200);
curveVertex(-200, 200);
endShape();
// save('self-portrait-v1.png');
}