xxxxxxxxxx
70
//John Armella _ Self_Portrait_Pattern_Variations
var y = 200;
function setup() {
createCanvas(800, 550);
}
function mouseClicked() {
save("pattern_variations.png "); //Self_Portrait_Version_1_Jonathan_Armella
}
function draw() {
background("#B85D2B");
for (let x = 0; x <= width; x += 400) {
let w = random(["white", "red", "yellow", "blue", "pink", "black"]);
let s = random(20, 100);
//Body
fill("#222222"); //Black
rectMode(CENTER);
rect(x, y + 160, 250, 300, 10);
//Face
noStroke(); //Face
fill("#F8E36E"); //Beige
ellipse(x, y, 300, 200); //Irregular Circle for face
//Hands
ellipse(x + 90, y + 190, 50);
ellipse(x - 110, y + 190, 50);
//Hat
fill("#222222"); //Black
rectMode(CENTER);
rect(x, y - 80, 250, 50); //Latter half of hat
ellipse(x, y - 110, 240, 100); //Top part of hat
//Hatlogo
fill("#BDBEBF"); //Gray
rectMode(CENTER);
rect(x, y - 80, 30, 30);
//hat logo inside
fill("#F5B625"); //Orange
ellipseMode(CENTER);
ellipse(x, y - 80, 20);
//Eyes
fill(w); //Random
ellipse(x + 60, y, s); //Right eye
ellipse(x - 70, y, s); //Left eye
//Pupil
fill("#222222"); //Black
ellipse(x + 60, y, 20); //Right pupil
ellipse(x - 70, y, 20); //Left pupil
//Mouth
strokeWeight(2);
stroke("#222222"); //Black
line(x + 60, y + 50, x - 70, y + 50); //Mouth
//Eyebrows
line(x + 80, y - 30, x + 30, y - 30); //Right eyebrow
line(x - 40, y - 30, x - 90, y - 30); //Left eyebrow
}
noLoop();
}