xxxxxxxxxx
105
let r, g, b;
let angle=0
var n = 0
let currentColour;
let nextColour;
let step = 0;
function setup() {
noStroke()
createCanvas(600, 400);
yellow = color(251, 210, 6)
peach = color(254, 175, 138)
salmon = color(253, 122, 140)
lilac = color(204, 137, 214)
pastelgreen = color(156, 231, 201)
bluegrey = color(191, 207, 240)
raingreen = color(77, 198, 86)
colors = [yellow, peach, salmon, lilac, pastelgreen, bluegrey, raingreen];
currentColour = random(colors);
nextColour = random(colors);
}
//function mousePressed() {
//r = random(100);
//g = random(70);
//b = random(100);
//}
function draw() {
let backgroundColour = lerpColor(currentColour, nextColour, step/20);
step++;
if (step >= 20) {
step = 0;
currentColour = nextColour;
nextColour = random(colors);
}
background(backgroundColour);
n += 1
if (n > 6) n = 0
frameRate(20);
//ears
push()
stroke(248, 75, 219);
strokeWeight(10);
strokeJoin(ROUND);
fill(240,188, 239)
triangle(268, 150, 230, 130, 240, 170)
triangle(332, 150, 370, 130, 360, 170)
pop()
//sound
push()
stroke(248, 75, 219);
strokeWeight(10);
fill(240,188, 239)
arc(230, 230, 60, 45, PI / 2, 3 * PI / 2, OPEN);
arc(370, 230, 60, 45, 3 * PI / 2, PI / 2, OPEN);
pop()
//muffs
push()
fill(166,170, 178)
ellipse(240, 230, 20, 50)
ellipse(360, 230, 20, 50)
pop()
//arc
push()
stroke(240,145, 237);
strokeWeight(15);
noFill();
arc(300, 250, 140, 230, PI, 0, OPEN);
pop()
//nose
push()
stroke(0);
strokeWeight(8);
strokeJoin(ROUND);
triangle(295, 205, 305, 205, 300, 210)
pop()
//whiskers
push()
stroke(133, 108, 113);
strokeWeight(3);
line(285, 200, 270, 190)
line(315, 200, 330, 190)
line(285, 210, 270, 220)
line(315, 210, 330, 220)
line(285, 205, 270, 205)
line(315, 205, 330, 205)
pop()
}