sizeSlider = createSlider(20, 2000, 1);
frameRateSlider = createSlider(1, 100, 60);
background(pow(sin(cor),2)*255);
translate(width/2, height/2);
starSize = sizeSlider.value();
frameRateValue = frameRateSlider.value();
frameRate(frameRateValue);
for (let i = 0; i < 8; i = i + 1) {
fill(map(mouseX, 0, width, 0, 255), pow(sin(cor),2)*255, map(mouseY, 0, height, 0, 255));
starShape(0, 0, starSize, 5);
stroke(255-pow(cos(cor+45),2)*255);
starShape(0, 0, starSize, 5, 0, 180);
stroke(pow(cos(cor+45),2)*255);
starShape(0, 0, starSize, 5, 180, 360);
function starShape(x, y, size, npoints, startAngle, endAngle) {
let angle = TWO_PI / npoints;
let halfAngle = angle / 2.0;
for (let a = startAngle; a < endAngle; a += angle) {
let sx = x + cos(a) * size;
let sy = y + sin(a) * size;
sx = x + cos(a + halfAngle) * size/2;
sy = y + sin(a + halfAngle) * size/2;