Takes about 30 seconds to make you a generative art piece! Refresh for new piece
A fork of Reflectance by Joe DeNavas (DD89)
xxxxxxxxxx
let noiseMax = 0.01;
let goal = 5;
let start = 0;
let z = 0;
let posM;
let lastM;
let x1=[]
let y1=[]
let a=0
let b=9
var ranges;
let seed = Math.random() * 12;
// colors
let colors1 = "fef9fb-fafdff-ffffff-fcfbf4-f9f8f6".split("-").map((a) => "#" + a);
let colors2 = "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 color1, color2;
function setup()
{
pixelDensity(2);
randomSeed(seed);
createCanvas(windowWidth, windowHeight);
background("#202020");
ranges = 50;
color1 = random(colors1);
color2 = random(colors2);
for (let y = 0; y < height; y++)
{
stroke(random(colors2));
line(0,y,width,y)
}
for(p=0;p<20;p++)
{
append(x1,random(width))
append(y1,random(height))
}
}
function draw()
{
if(b>=-52)
{
b=b-.15
seed=100
blendMode(DIFFERENCE);
noFill();
strokeWeight(5);
a=a+.01
if(!lastM) lastM = createVector(0,0);
else if(posM) lastM = posM;
posM = createVector(0,0);
let distance = sqrt( pow(posM.x-lastM.x, 2) + pow(posM.y - lastM.y,2) ) / 10;
if(distance > 5) goal = distance;
distance = 0;
if(noiseMax < goal) noiseMax *= 1.1;
else
{
goal = 5;
noiseMax *= 0.99;
}
noFill();
stroke(color2);
drawingContext.shadowColor = random(colors1);
drawingContext.shadowOffsetX = 1;
drawingContext.shadowOffsetY = 1;
drawingContext.shadowBlur = 0;
for(p=0;p<20;p++)
{
strokeWeight(random(10))
beginShape();
for(let i = 0; i < TWO_PI; i += (PI/100))
{
xoff = map(cos(i+start),-1,1,0,noiseMax);
yoff = map(sin(i),-1,1,0,noiseMax);
let r = map(noise(xoff,yoff,z),p+0,5,-500,1000);
let x = r * sin(i)/b ;
let y = r * cos(i)/b ;
vertex(x+x1[p],y+y1[p]);
}
endShape(CLOSE);
}
z += 0.01;
}
}