xxxxxxxxxx
69
let co =0
function setup() {
createCanvas(1600, 1600);
randomSeed(4);
noiseSeed(3);
noLoop();
c1 = color("#838383");
c2 = color(63, 191, 191);
strokeWeight(3)
for (let y = 0; y < height; y++) {
n = map(y, 0, height, 0, 1);
let newc = lerpColor(c1, c2, n);
stroke(newc);
line(0, y, width, y);
}
background(60)
}
function draw() {
stroke(50); // Set the stroke color to a dark shade
strokeWeight(2); // Vary the line weight
//colorMode(HSB, 100);
lineNoise(width * 0.1, height * 0.3, width * 0.9, height * 0.7);
lineNoise(width * 0.1, height * 0.6, width * 0.5, height * 0.9);
lineNoise(width * 0.3, height * 0.1, width * 0.5, height * 0.9);
lineNoise(width * 0.7, height * 0.1, width * 0.5, height * 0.9);
// lineNoise(width * 0.9, height * 0.8, width * 0.5, height * 0.9);
co=0
// lineNoise(width*0.1, height*0.1, width*0.4, height*0.5)
// lineNoise(width*0.5, height*0.1, width*0.4, height*0.5)
// lineNoise(width*0.1, height*0.5, width*0.4, height*0.5)
// lineNoise(width*0.9, height*0.1, width*0.4, height*0.5)
// lineNoise(width*0.1, height*0.9, width*0.4, height*0.5)
// lineNoise(width*0.9, height*0.9, width*0.4, height*0.5)
// lineNoise(width*0.5, height*0.9, width*0.4, height*0.5)
// lineNoise(width*0.9, height*0.5, width*0.4, height*0.5)
}
function lineNoise(x1, y1, x2, y2) {
let segments = width / 3;
// x1 = x1*random(0.8,1.4)
// y1 = y1*random(0.8,1.4)
for (let i = 0; i <= segments; i++) {
let t = i / segments;
let x = lerp(x1, x2, t);
let y = lerp(y1, y2, t);
let noiseValue = noise(x * 0.005, y * 0.005);
let angle = map(noiseValue, 0, 1, -PI, PI); // Vary the angle based on noise
let length = map(noiseValue, 0, 1, 25, 300); // Vary the line length based on noise
let xEnd = x + cos(angle) * length;
let yEnd = y + sin(angle) * length;
stroke(noiseValue*255, noiseValue*255,120,);
line(x, y, xEnd, yEnd);
}
co+=3
}