let a, b, n, t = 1;
let rayon = 450;
let rayon2 = 150;
let num = 110;
let start = 0;
let c;
let rotate_Angle = 0;
function setup() {
//c = createCanvas(300, 300);
c = createCanvas(1000, 800); // 16:9
var myInterval = setInterval(everyTime, 5500);
colorMode (HSB, 360, 100, 100, 100);
background(10, 100, 1, 100);
start = random(360);
//circle (width/2, height/2, 2*rayon);
}
function draw () {
//clear();
translate (width/2, height/2);
rotate (radians(rotate_Angle));
for (n = 0; n < num; n++) {
line(-rayon, -rayon*sin(a=TAU*noise(n*t)), random(-rayon, rayon), rayon*sin(b=TAU*noise(n*n*t)));
}
stroke((start+(frameCount*1.5)%90)%360, 80+frameCount%40, 90+frameCount%20, 0.8*noise(n));
t += 0.005;
rayon -= .5;
if (rayon < 0) {
rayon = 450;
}
}
function mousePressed () {
clear();
start = random(360);
//
}
function everyTime() {
//rotate_Angle = (90*frameCount)%360;
start = random(360);
}
function keyPressed(){
if (key == ‘ ‘){ //this means space bar, since it is a space inside of the single quotes
saveCanvas(c, ‘myCanvas’, ‘png’);
}
else if (keyCode === ENTER){
aColor = « red »;
}
}