xxxxxxxxxx
60
//https://reposhub.com/javascript/misc/SYM380-p5-pattern.html#articleHeader2
//https://openprocessing.org/sketch/1278485
let PALETTE;
function setup() {
createCanvas(600, 600);
frameRate(0.75);
}
function draw() {
background("#141313");
ellipseMode(CENTER);
rectMode(CENTER);
const d = width / 2;
pattern(randPattern(d));
circlePattern(width/2, height/2, d);
//rectPattern(width / 2, height / 2, d, d);
//trianglePattern(200, 60, 70, 300, 330, 300);
/*point(200,60);
point(70, 300);
point(330, 300);*/
}
function randPattern(t) {
const ptArr = [
PTN.noise(0.5),
PTN.noiseGrad(0.4),
PTN.stripe(t / int(random(6, 12))),
PTN.stripeCircle(t / int(random(6, 12))),
PTN.stripePolygon(int(random(3, 7)), int(random(6, 12))),
PTN.stripeRadial(TAU / int(random(6, 30))),
PTN.wave(t / int(random(1, 3)), t / int(random(10, 20)), t / 5, t / 10),
PTN.dot(t / 10, (t / 10) * random(0.2, 1)),
PTN.checked(t / int(random(5, 20)), t / int(random(5, 20))),
PTN.cross(t / int(random(10, 20)), t / int(random(20, 40))),
PTN.triangle(t / int(random(5, 20)), t / int(random(5, 20))),
];
return random(ptArr);
}
function mouseClicked() {
save('image.png');
}