xxxxxxxxxx
50
//Fluid Stains
//Created by Mirette Dahab
//January 4th, 2025
//independant work
//pink-red
let start = 0;
let inc = 3;
let gradientSpeed = 0.01; // Speed of gradient animation
let gradientOffset = 0; // Offset for scrolling the gradient
let rotationSpeed = 0.005; // Speed of line rotation
let rotationAngle = 0; // Initial rotation angle
let hueRange = 100; // Define the range of hues for harmony
let baseHue = 360; // Central hue (you can change this for different harmonic palettes)
function setup() {
createCanvas(410, 410);
colorMode(HSB, 360, 100, 100); // Use HSB color mode for hue control
}
function draw() {
// Scroll the gradient smoothly
gradientOffset += gradientSpeed;
let t = noise(gradientOffset);
push();
translate(width / 2, height / 2); // Move to the center of the canvas
rotationAngle += rotationSpeed;
for (let i = 0; i < height; i++) {
let inter = map(i, 0, height, 0, 1);
// Cycle through the harmonious hue range
let hueValue = map((inter + t) % 1, 0, 1, baseHue - hueRange / 2, baseHue + hueRange / 2);
let c = color(hueValue, 100, 100); // Full saturation and brightness for vibrancy
push();
rotate(rotationAngle + map(i, 0, height, -PI / 20, PI / 20)); // Different rotation for each line
stroke(c);
line(10, i - height / 4, width / 128, i - height / 4); // Line with rotation
pop();
}
pop();
// Increment start for animation
start += inc;
}