xxxxxxxxxx
let w = 834;
flag = 0;
function setup() {
createCanvas(w*4/3, w);
frameRate(1);
//back draw
background(230, 228, 225);
strokeWeight(0.5);
for(let i=0;i<width;i++){
for(let j=0;j<height;j++){
stroke(230 + 30*(0.5 - noise(0.04*i, 0.06*j), 250));
point(i, j);
}
}
}
function draw(){
//main draw
if (random(1) > .7){
blendMode(BURN);
} else {
blendMode(SCREEN);
}
noFill();
strokeWeight(0.1);
translate(1112/2, w/2);
let colpat = [ [20, 50, 80],
[80, 20, 50]
];
let nn = 5;
let n = nn * 1.75;
for(let k=1;k<nn; k++){
push();
rotate(PI/8*k);
for(let i=0;i<360; i+=45){
push();
rotate(radians(i));
let ctrlP = 4;
for(let j=0;j<40;j+=0.1){
let ctrlX = j * ctrlP;
let ctrlY = j * ctrlP;
let mapi2 = map(j, 25, 50, 50, 0);
stroke(colpat[k%2][0]+20*noise(0.2*j, i*0.6, k*0.3),
colpat[k%2][1]+50*noise(0.075*j, i*0.5, k*0.6),
colpat[k%2][2]+60*noise(0.095*j, i*0.9, k*0.8),
mapi2*noise(0.075*j, i, k));
line(0, w/n*k, ctrlX, 0);
line(0, ctrlY, w/n*k, 0);
}
pop();
}
pop();
}
}
// save jpg
let lapse = 0; // mouse timer
function mousePressed(){
if (millis() - lapse > 400){
save("img_" + month() + '-' + day() + '_' + hour() + '-' + minute() + '-' + second() + ".jpg");
lapse = millis();
}
}