let dR, r, r0, rMax, deltaAlpha;
colorMode(HSB, 360, 100, 100,100);
center = createVector(0.5*width,0.5*height,0.0);
let colorArray = [color(212,81,61,transparency),
color(357,83,55,transparency),
color(232,45,19,transparency),
color(21,67,49,transparency),
color(357,84,55,transparency),
color(215,57,27,transparency),
color(11,83,59,transparency),
color(213,73,42,transparency),
color(357,68,41,transparency),
color(21,23,47,transparency),
color(2,74,39,transparency),
color(359,71,58,transparency),
color(21,67,66,transparency),
let starColor = colorArray[(n-i-1)%13];
stars[i] = new Star(starColor, color(360,0,100,0),center,r);
stars[i].alpha = PI*0.1+ i*deltaAlpha;
if (stars[0].outerRadius > rMax) {
stars[0].outerRadius = 0;
stars[0].innerRadius = 0;
stars[0].alpha = stars[n-1].alpha - deltaAlpha;
let reorderdStars = new Array(n);
for(let i=0; i<n-1; i++) {
reorderdStars[i] = stars[i+1];
reorderdStars[n-1] = stars[0];
constructor(c, strokecolor, centerPoint, radius) {
this.outerRadius = radius;
this.ratio = 1 / sqrt(5);
this.innerRadius = radius * this.ratio;
this.strokeColor = strokecolor;
this.center = centerPoint;
this.theta = PI / this.numberOfPoints;
this.alpha = this.theta * 0.5;
this.outerRadius += 0.5 ;
this.innerRadius = this.outerRadius * this.ratio;
let h = hue(this.fillColor);
this.fillColor = color(h, saturation(this.fillColor), brightness(this.fillColor));
translate(this.center.x, this.center.y);
beginShape(TRIANGLE_FAN);
for(let i=0; i<2 * this.numberOfPoints; i = i + 2) {
vertex(this.innerRadius * cos(i * this.theta) , this.innerRadius * sin(i * this.theta));
vertex(this.outerRadius * cos((i + 1) * this.theta) , this.outerRadius * sin((i + 1) * this.theta));
vertex(this.innerRadius, 0);