xxxxxxxxxx
49
//Darkness disco
//Created by Mirette Dahab
//January 3rd, 2025
//independant work
//Genuary day 3
//Prompt: 42 lines of Code
let hueValue = 0;
let noiseOffset = 0; // Initialize hue value and noise offset for dynamic elements
function setup() {
createCanvas(400, 400);
colorMode(HSB, 360, 100, 100); // Set color mode to HSB
noFill();
}
function draw() {
background(hueValue, 80, 100); // Smoothly change hue for background
hueValue = (hueValue + 1) % 360; // Loop hue after 360
for (let i = -100; i < 1000; i += 5) {
noiseOffset += 0.1;
let weight = noise(noiseOffset) * 19 + 1;
strokeWeight(weight);
stroke(0, 0, 20, 0.6); // Subtle dark strokes
line(i + 51, i + 51, i + 51, 351 - i);
line(i + 49, i + 51, 351 - i, i + 51);
}
strokeWeight(2);
stroke(0, 0, 100, 0.4);
beginShape();
for (let x = 0; x < width; x += 10) {
let y = height/2 + noise(x * 0.5, frameCount * 0.01) * 100 - 50;
vertex(x, y);
}
endShape();
for (let i = 0; i < 360; i += 20) {
let angle = radians(i);
let radius = 100 + sin(frameCount * 0.05 + angle) * 40;
let x = width / 2 + cos(angle) * radius;
let y = height / 2 + sin(angle) * radius;
strokeWeight(5);
stroke((hueValue + i) % 360, 90, 100); // Vibrant points
point(x, y);
}
}