xxxxxxxxxx
44
// Set up canvas and background
function setup() {
createCanvas(500, 500);
background(128, 0, 0); // maroon background
}
// Draw the face and other elements
function draw() {
// Face
noStroke();
fill(250, 128, 114);
ellipse(260, 255, 150, 260);
// Eyes
fill(80, 30, 10);
ellipse(210, 220, 38, 25);
ellipse(310, 220, 38, 25);
// Pupils
noStroke();
fill(0);
ellipse(207, 222, 8, 8);
ellipse(306, 222, 8, 8);
// Mouth
noStroke();
fill(153, 0, 25); // ruby red for the mouth
arc(260, 280, 40, 15, 0, PI + QUARTER_PI, CHORD);
// Nose (optional)
// Triangle commented out
// fill(255, 200, 170);
// triangle(270, 238, 260, 255, 255, 238);
// Nose (alternative version)
fill(255, 200, 170);
rect(255, 235, 10, 30, 145); // Rounded nose
}
function mousePressed(){
save('self-portrait-1.jpg')
}