createCanvas(h, h * 19 / 32);
colorMode(HSB, 360, 100, 100, 1.0);
const noiseScale = 0.005;
drawLine(i, 0, width, inc, "x");
drawLine(i * (width / height), 0, height, inc, "y");
drawLine(i, 0, width, inc * 5, "x", alpha);
drawLine(i * (width / height), 0, height, inc * 5, "y", alpha);
if (i >= max(height, width) + inc) {
function getNoise(x, y) {
return noise(x * noiseScale, y * noiseScale);
function getColorIndex(x, y) {
const n = getNoise(x, y);
return round(map(n * 10, 0, 10, 0, colors.length - 1));
function drawLine(i, start, max, inc, dir, a) {
for (var k = start; k <= max + inc; k += inc) {
const x = dir === "x" ? k : i;
const y = dir === "x" ? i : k;
const d00 = dist(width / 2, height / 2, 0, 0);
const d = dist(width / 2, height / 2, x, y);
const ci = getColorIndex(x, y);
const w = d > t ? sin(d / t) : (cos(d / t));
const n = getNoise(x, y);
const s = w * map(n, 0, 1, inc * 0.618, inc);
c.setAlpha(d > t ? 0.01 : a);
const xs = dir === "x" ? s : s;
const ys = dir === "x" ? s : s;