xxxxxxxxxx
/*
colored rug #genuary27 #genuary #genuary2527
Make something interesting with no randomness or noise or trig.
https://openprocessing.org/sketch/2523076
#generativeart #creativecoding #p5js
*/
let pal;
function setup() {
createCanvas(S=min(windowWidth, windowHeight), S);
describe("repeating colored lines slightly rotating forming a colored rug")
frameRate(60);
pal = palettes[frameCount%palettes.length];
background(32);
}
function draw() {
push();
translate(width/2, height/2)
rotate(frameCount/1234)
translate(-width/2, -height/2)
stroke(pal[frameCount%pal.length]);
const f = fract(millis()/3456);
const hv = (~~(f*10)) % 2 === 0;
if (hv) {
line(0, f*height, width, f*height);
} else {
line(f*width, 0, f*width, height);
}
pop();
drawMsg("Colored rug (epi) #genuary2527")
}
function drawMsg(msg) {
push();
blendMode(BLEND);
fill("black")
noStroke();
textAlign(LEFT, TOP)
text(msg, 1, 1)
fill("white")
noStroke();
textAlign(LEFT, TOP)
text(msg, 0, 0)
pop();
}
function mousePressed() {
if (mouseButton != RIGHT) setup();
}