size(600, 800); // this could be changed to resize the sketch // declare variables that help define our geometry float centerX = 0.5 * width; // x-coordinate of the center of the face float centerY = 0.675 * height; // y-coordinate of the center of the face float faceWidth = 0.5 * width; // diameter of the circle that forms the face color hatColor = color(127, 127, 255); // a periwinkle // the face outline ellipse(centerX, centerY, faceWidth, faceWidth); // the portions of the hat fill(hatColor); float hatWidth = 0.667 * faceWidth; float hatHeight = 1.25 * hatWidth; rect(centerX - hatWidth/2, centerY - 0.5*faceWidth - hatHeight, hatWidth, hatHeight); float brimWidth = 1.167 * faceWidth; float brimHeight = 0.25 * faceWidth; rect(centerX - brimWidth/2, centerY - 0.5*faceWidth, brimWidth, brimHeight); // the eyes of the face strokeWeight(0.067 * faceWidth); point(centerX - faceWidth/6, centerY - faceWidth/6); point(centerX + faceWidth/6, centerY - faceWidth/6); // the mouth strokeWeight(2); noFill(); arc(centerX, centerY + faceWidth/6, 0.67 * faceWidth, faceWidth/6, PI/8, PI*7/8);