let seed = Math.random() * 847;
let colors1, colors2, colorsbg;
let colors_blue1 = "fefefe-ffffff-202020-72cffe-deedfc".split("-").map((a) => "#" + a);
let colors_blue2 = "012340-162D59-8FB6D9-C9DFF2-1B70A6-4590BF-034C8C".split("-").map((a) => "#" + a);
let colors_bluebg = "012340-034C8C-021859".split("-").map((a) => "#" + a);
let color_blue1, color_blue2;
let colorselet_blue = [];
let colors_red1 = "fefefe-ffffff-202020-F2CFBB-F26F63".split("-").map((a) => "#" + a);
let colors_red2 = "F2CFBB-F24B78-D90404-F26F63-590202-4A0400-A60F37".split("-").map((a) => "#" + a);
let colors_redbg = "590202-4A0400-A60F37".split("-").map((a) => "#" + a);
let color_red1, color_red2;
let colors_grayBlue = [];
let colors_grayBlue1 = "fefefe-ffffff-202020-151B26-364559".split("-").map((a) => "#" + a);
let colors_grayBlue2 = "707F8C-8F9BA6-364559-151B26-3A6273-3C667E-".split("-").map((a) => "#" + a);
let colors_grayBluebg = "3A6273-364559-151B26".split("-").map((a) => "#" + a);
let color_grayBlue1, color_grayBlue2;
let colorselet_grayBlue = [];
let colors_colorful = [];
let colors_colorful1 = "fefefe-292929-262626-222222-202020".split("-").map((a) => "#" + a);
let colors_colorful2 = "8c75ff-c553d2-2dfd60-2788f5-23054f-f21252-8834f1-c4dd92-184fd3-f9fee2-2E294E-541388-F1E9DA-FFD400-D90368-e9baaa-ffa07a-164555-ffe1d0-acd9e7-4596c7-6d8370-e45240-21d3a4-3303f9-cd2220-173df6-244ca8-a00360-b31016".split("-").map((a) => "#" + a);
let colors_colorfulbg = "fefefe-292929-262626-222222-202020".split("-").map((a) => "#" + a);
let color_colorful1, color_colorful2;
let colorselet_colorful = [];
let count, wideCount, highCount;
theShader = new p5.Shader(this.renderer, vert, frag)
mySize = min(windowWidth, windowHeight);
createCanvas(mySize, mySize / 16 * 11);
webGLCanvas = createGraphics(width, height, WEBGL);
originalGraphics = createGraphics(width, height);
overGraphics = createGraphics(width, height);
if (int(seed) % 4 == 0) {
colors = colors_colorful;
colors1 = colors_colorful1;
colors2 = colors_colorful2;
colorsbg = colors_colorfulbg;
color1 = color_colorful1;
color2 = color_colorful2;
colorselet = colorselet_colorful;
if (int(seed) % 4 == 1) {
colorselet = colorselet_red;
if (int(seed) % 4 == 2) {
colors = colors_grayBlue;
colors1 = colors_grayBlue1;
colors2 = colors_grayBlue2;
colorsbg = colors_grayBluebg;
color1 = color_grayBlue1;
color2 = color_grayBlue2;
colorselet = colorselet_grayBlue;
if (int(seed) % 4 == 3) {
colorsbg = colors_bluebg;
colorselet = colorselet_blue;
colorselet[0] = random(colors1);
colorselet[1] = random(colors2);
colorselet[2] = random(colors2);
colorselet[3] = random(colors2);
colorselet[4] = random(colors1);
unit = mySize / int(random(28, 14));
let wideCount = width / unit + 1;
let highCount = height / unit + 1;
count = wideCount * highCount;
for (let y = 0; y < highCount; y++) {
for (let x = 0; x < wideCount; x++) {
arcs[index++] = new Brush(
2 * unit / random(0.5, 2)
let filter1 = new makeFilter();
background(random(colorsbg));
webGLCanvas.shader(theShader);
theShader.setUniform('u_resolution', [width / width, height / height]);
theShader.setUniform('u_time', millis() / 1000);
theShader.setUniform('u_mouse', [mouseX / width, mouseY / height]);
theShader.setUniform('u_tex', originalGraphics);
webGLCanvas.rect(-width / 2, -height / 2, width, height);
if (int(seed) % 3 == 0) {
for (let i = 0; i < count; i++) {
arcs[i].drawArc(originalGraphics);
if (int(seed) % 3 == 1) {
for (let i = 0; i < count; i++) {
arcs[i].drawCir(originalGraphics);
if (int(seed) % 3 == 2) {
for (let i = 0; i < count; i++) {
arcs[i].drawRect(originalGraphics);
image(webGLCanvas, 0, 0);
image(overAllTexture, 0, 0);
constructor(xOff, yOff, x, y, speed, unit) {
this.x = this.x + this.speed * this.xDir;
if (this.x >= this.unit || this.x <= 0) {
this.x = this.x + 1 * this.xDir;
this.y = this.y + 1 * this.yDir;
if (this.y >= 1 * this.unit || this.y <= 0) {
this.y = this.y + 1 * this.yDir;
p.stroke(str(random(colorselet)) + "80");
p.strokeWeight(random(random()));
let y_size = random(mySize / count * 40, mySize / count * 70) * noise(sin(this.x), cos(this.y), frameCount * 0.01);
let xx = this.xOff + sin(this.x - ele_ang);
let yy = this.yOff - cos(this.y - ele_ang);
p.rotate(random(TAU) + ele_ang);
p.translate(random(-ele_ang, ele_ang), random(-ele_ang, ele_ang));
p.arc(random(-y_size, y_size), random(-y_size, y_size), random(y_size), random(y_size),
random(-PI), random(PI));
ele_ang += TAU / random(300, 360) / 5000;
p.stroke(str(random(colorselet)) + "80");
p.strokeWeight(random(random()));
let y_size = random(mySize / count * 40, mySize / count * 70) * noise(sin(this.x), cos(this.y), frameCount * 0.01);
let xx = this.xOff + sin(this.x - ele_ang);
let yy = this.yOff - cos(this.y + ele_ang);
p.rotate(random(TAU) + ele_ang);
p.translate(random(-ele_ang, ele_ang), random(-ele_ang, ele_ang));
if (int(seed) % 2 == 1) {
p.strokeWeight(random(random(2)));
p.drawingContext.setLineDash([1, 1, 2, 10, 3, 10, 1, 1, 2, 10]);
p.ellipse(random(-y_size, y_size), random(-y_size, y_size), random(y_size), random(y_size));
ele_ang += TAU / random(300, 360) / 5000;
p.stroke(str(random(colorselet)) + "80");
p.strokeWeight(random(random()));
let y_size = random(mySize / count * 40, mySize / count * 70) * noise(sin(this.x), cos(this.y), frameCount * 0.01);
let xx = this.xOff + sin(this.x - ele_ang);
let yy = this.yOff - cos(this.y - ele_ang);
p.rotate(random(TAU) + ele_ang);
p.translate(random(-ele_ang, ele_ang), random(-ele_ang, ele_ang));
p.rect(random(-y_size, y_size), random(-y_size, y_size), random(y_size) / 2, random(y_size) / 2);
ele_ang += TAU / random(300, 360) / 10000;
colorMode(HSB, 360, 100, 100, 100);
drawingContext.shadowColor = color(0, 0, 5, 5);
overAllTexture = createGraphics(width, height);
overAllTexture.loadPixels();
for (var i = 0; i < width; i++) {
for (var j = 0; j < height; j++) {
color(0, 10, 70, noise(i / 3, j / 3, (i * j) / 50) * random(10, 25))
overAllTexture.updatePixels();
function drawOverPattern() {
translate(width / 2, height / 2);
let s = mySize / 2 * sqrt(3) - 2;
for (let theta = TWO_PI / 6; theta < TWO_PI; theta += TWO_PI / 6) {
divideOP(0, 0, s * cos(theta), s * sin(theta), s * cos(theta + TWO_PI / 6), s * sin(theta + TWO_PI / 6), n);
function prop(x1, y1, x2, y2, k) {
let x3 = (1 - k) * x1 + k * x2;
let y3 = (1 - k) * y1 + k * y2;
function divideOP(x1, y1, x2, y2, x3, y3, n) {
let [xA, yA] = prop(x1, y1, x2, y2, 1 / 3);
let [xB, yB] = prop(x1, y1, x2, y2, 2 / 3);
let [xC, yC] = prop(x2, y2, x3, y3, 1 / 3);
let [xD, yD] = prop(x2, y2, x3, y3, 2 / 3);
let [xE, yE] = prop(x3, y3, x1, y1, 1 / 3);
let [xF, yF] = prop(x3, y3, x1, y1, 2 / 3);
let [xG, yG] = prop(xF, yF, xC, yC, 1 / 2);
divideOP(x1, y1, xA, yA, xF, yF, n - 1);
divideOP(xA, yA, xB, yB, xG, yG, n - 1);
divideOP(xB, yB, x2, y2, xC, yC, n - 1);
divideOP(xG, yG, xF, yF, xA, yA, n - 1);
divideOP(xC, yC, xG, yG, xB, yB, n - 1);
divideOP(xF, yF, xG, yG, xE, yE, n - 1);
divideOP(xG, yG, xC, yC, xD, yD, n - 1);
divideOP(xD, yD, xE, yE, xG, yG, n - 1);
divideOP(xE, yE, xD, yD, x3, y3, n - 1);
makeTriangle([x1, y1], [x2, y2], [x3, y3]);
function makeTriangle(v1, v2, v3) {
let points = shuffle([v1, v2, v3]);
let [x1, y1] = points[0];
let [x2, y2] = points[1];
let [x3, y3] = points[2];
let iStep = 1 / (pow(2, floor(random(4, 2))));
for (let i = 0; i < 1; i += iStep) {
let [x4, y4] = prop(x1, y1, x2, y2, 1 - i);
let [x5, y5] = prop(x1, y1, x3, y3, 1 - i);
triangle(x1, y1, x4, y4, x5, y5);
if (key === "s" || key === "S") {
strokeWeight(random(0.1, 0.05));
stroke(str(random(colors2)) + "1a");
drawingContext.setLineDash([1, 1, 1, 1]);
rect(0, 0, width, height);
saveCanvas("0901_NoisePlanet_moody2_2022", "png");
function mousePressed() {
if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) {