xxxxxxxxxx
41
// I <3 You
// By Supriyo Paul
function setup() {
createCanvas(windowWidth,windowHeight);
background(0);
}
let spot = {
x: 0,
y: 0,
}
let Color ={
r:0,
g:0,
b:0
}
function draw() {
Color.r = random(0,200);
Color.b= random(0,255);
spot.x = random(0,windowWidth);
spot.y =random(0,windowHeight)
translate(spot.x, spot.y);
noStroke();
fill(Color.r,Color.g,Color.b,120);
beginShape();
for (let a = 0; a < TWO_PI; a += 0.1) {
const r = 2;
const x = r * 16 * pow(sin(a), 3);
const y = -r *(13 * cos(a) - 5 * cos(2 * a) - 2 * cos(3 * a) - cos(4 * a));
vertex(x, y);
}
endShape();
frameRate(10);
}
function mousePressed() {
background(0);
}