xxxxxxxxxx
69
let g;
function setup() {
createCanvas(500, 500);
}
function draw() {
//background(222,184,135)
let r = map(mouseX,0,width,139,244,true);
let g = map(mouseX,0,width,69,164,true);
let b = map(mouseX,0,width,19,96,true);
// background(a);
background(r,g,b);
noStroke();
//face
let x = map(mouseX,0,width,222,255,true);
let y = map(mouseX,0,width,184,226,true);
let z = map(mouseX,0,width,135,194,true);
fill(x,y,z);
square(50,50,400);
//left eye white
fill(255);
ellipse(140,220,120);
//right eye white
fill(255);
ellipse(355,220,120);
//left black
let l =map(mouseX,0,width,185,100,true);
fill(0);
ellipse(l,220,30);
//right black
let k = map(mouseX,0,width,400,330,true);
fill(0);
ellipse(k,220,30);
let a = map(mouseX,0,width,139,244,true);
let u = map(mouseX,0,width,69,164,true);
let c = map(mouseX,0,width,19,96,true);
//left eyelid
fill(a,u,c);
arc(140, 220, 120, 120, -PI, 0, CHORD);
//right eyelid
fill(a,u,c);
arc(355, 220, 120, 120, -PI, 0, CHORD);
//left eyebrow
let e = map(mouseX, 0, width, 150, 100, true);
fill(205,133,63);
rect(75,e,120,20);
//right eyebrow
let i = map(mouseX,0,width,150,100,true)
rect(300,i,120,20);
//mouth
push();
rectMode(CENTER);
let m = map(mouseX,0,width,200,20,true);
fill(a,u,c);
rect(250,375,m,20);
pop();
}