xxxxxxxxxx
191
let eyeColor;
let eyeColor1;
let eyeColor2;
let eyeColor3;
let bgColor = 0;
let bgColor1 = 0;
let bgColor2 = 0;
let leftEyePosition = 0;
let rightEyePosition = 0;
let mouthX = 0
function setup() {
createCanvas(400, 400);
}
function draw() {
let mouseYcon = (min(max(mouseY,1), 120));
let mouseXcon = (min(max(mouseX,100), 170));
let mouseYnose = (min(max(mouseY,30), 200));
let mouseYmouth = (min(max(mouseY,1), 150));
let mouseRadians = (min(max(mouseX,1), 360));
background(255);
//cheeks--------------------------------
push();
noStroke();
fill(mouseX,40,mouseY,50);
ellipse(50,200, 100,100);
ellipse(350,200, 100,100);
pop();
//mouth --------------------------------
angle = map(mouseX, 0, width, 0, TWO_PI);
push();
strokeWeight(10);
noFill();
translate(200,310);
rotate(angle);
arc(mouthX, 0, mouseYmouth, mouseYmouth, 0, radians(mouseRadians))
pop();
//nose -----------------------------------
push();
translate(width/2,160);
noStroke();
//booger
fill(0,200,0);
arc(15, 50, 20, mouseY-20, 0, PI)
fill(255);
rect(-40,35,80,30)
stroke(0);
strokeWeight(10);
arc(-25, 50, 30, mouseYnose, 0, PI + QUARTER_PI)
arc(0, 50, 20, mouseYnose, TWO_PI, PI)
arc(25, 50, 30, mouseYnose, PI+HALF_PI+QUARTER_PI, PI)
pop();
push();
translate(110,110);
//left eye
//eyeshadow2
push();
strokeWeight(20);
stroke(eyeColor2, eyeColor, eyeColor1);
arc(0,leftEyePosition-15, mouseXcon, mouseYcon, PI, TWO_PI);
pop();
//eyeshadow1
push();
strokeWeight(15);
stroke(eyeColor1, eyeColor2, eyeColor);
arc(0, leftEyePosition-5, mouseXcon, mouseYcon, PI, TWO_PI);
pop();
//main eye
strokeWeight(10)
arc(0, leftEyePosition, mouseXcon, mouseYcon, PI, TWO_PI);
arc(0, leftEyePosition, mouseXcon, mouseYcon, TWO_PI, PI);
push();
//main pupil
fill(eyeColor, eyeColor1, eyeColor2);
ellipse(0,leftEyePosition,mouseYcon);
//inner pupil circles
strokeWeight(6);
fill(eyeColor1, eyeColor2, eyeColor, 100);
ellipse(0,leftEyePosition,mouseYcon/2);
strokeWeight(5);
fill(eyeColor1, eyeColor1, eyeColor, 100);
ellipse(0,leftEyePosition,mouseYcon/3);
strokeWeight(2);
fill(eyeColor2, eyeColor1, eyeColor, 100);
ellipse(0,leftEyePosition,mouseYcon/4);
strokeWeight(1);
fill(eyeColor, eyeColor, eyeColor2, 100);
ellipse(0,leftEyePosition,mouseYcon/5);
fill(eyeColor2, eyeColor, eyeColor2, 100);
ellipse(0,leftEyePosition,mouseYcon/6);
pop();
pop();
//right eye ---------------------------------
push();
translate(290,110);
//eyeshadow2
push();
strokeWeight(20);
stroke(eyeColor2, eyeColor3, eyeColor1);
arc(0,rightEyePosition-15, mouseXcon, mouseYcon, PI, TWO_PI);
pop();
//eyeshadow1
push();
strokeWeight(15);
stroke(eyeColor3, eyeColor, eyeColor);
arc(0, rightEyePosition-5, mouseXcon, mouseYcon, PI, TWO_PI);
pop();
//main eye
strokeWeight(10)
arc(0, rightEyePosition, mouseXcon, mouseYcon, PI, TWO_PI);
arc(0, rightEyePosition, mouseXcon, mouseYcon, TWO_PI, PI);
push();
//main pupil
fill(eyeColor1, eyeColor3, eyeColor2);
ellipse(0,rightEyePosition,mouseYcon);
//inner pupil circles
strokeWeight(6);
fill(eyeColor3, eyeColor3, eyeColor, 100);
ellipse(0,rightEyePosition,mouseYcon/2);
strokeWeight(5);
fill(eyeColor1, eyeColor1, eyeColor, 100);
ellipse(0,rightEyePosition,mouseYcon/3);
strokeWeight(2);
fill(eyeColor2, eyeColor1, eyeColor3, 100);
ellipse(0,rightEyePosition,mouseYcon/4);
strokeWeight(1);
fill(eyeColor, eyeColor, eyeColor2, 100);
ellipse(0,rightEyePosition,mouseYcon/5);
fill(eyeColor2, eyeColor3, eyeColor2, 100);
ellipse(0,rightEyePosition,mouseYcon/6);
pop();
pop();
push();
noStroke();
blendMode(SCREEN);
fill(bgColor, bgColor1, mouseX,100);
rect(0,0,400,400)
pop();
}
function mousePressed() {
eyeColor = random(255);
eyeColor1 = random(255);
eyeColor2 = random(255);
eyeColor3 = random(255);
bgColor = random(255);
bgColor1 = random(255);
bgColor2 = random(255);
}
function keyPressed() {
//height of eyes
leftEyePosition = random(-20,70);
rightEyePosition = random(-20,70);
mouthX = random(-20,20);
}