SEckert-Project-02-Variable Face

seckert-project-02

var hairWidth = (400);
var hairHeight = (420);
var hairColor = ('#A62BFF');
var eyeColor = ('#000000');
var eyeSize = (10);
var mouthSize = (10);
var eyebrowHeight = 50;
var backgroundColor = 255;


function setup() {
    createCanvas(480, 640);
}

function draw() {

	background(backgroundColor);
  noStroke();
//hair
  fill(hairColor);
    ellipse ((width/2), (height/2), hairWidth, hairHeight);
//face
  fill('#F0DEFF');
    ellipse((width/2), (height/2), 250, 250);
//hair bangs
  fill(hairColor);
    ellipse ((width/2), ((height/2)-125), 150, 100);
//eyes
  fill(eyeColor);
    ellipse (((width/2)-50), ((height/2)-40), eyeSize, eyeSize);
    ellipse (((width/2)+50), ((height/2)-40), eyeSize, eyeSize);
//eyebrows
  fill (hairColor);
    rect (((width/2)-65), ((height/2)-eyebrowHeight), 30, 5);
    rect (((width/2)+(35)), ((height/2)-eyebrowHeight), 30, 5);
//mouth
  fill ('#000000');
    ellipse ((width/2), ((height/2)+30), mouthSize, mouthSize);
//nose
  fill ('#EBBAFF');
    ellipse ((width/2), (height/2), 30, 10);

  //noLoop()
}

function mousePressed() {
    hairWidth = random(400, 600);
    hairHeight = random(420, 620);
    hairColor = random(255);
    eyeColor = random(255);
    eyeSize = random(10, 30);
    mouthSize = random(10, 50);
    eyebrowHeight = random(50, 70);
    backgroundColor = random(0-255);
}

This project made me very aware of how little I remembered about programing in colors, particularly randomizing them. I’m sure that with more tinkering I could have added a lot more variety but I am happy with it as is.

Leave a Reply