['#031103','#336696','#215c6e','#428fb1','#52a3c3'],
['#b72104','#428fb1','#0d0b05','#aa252e','#ebe3f3'],
['#408bb0','#370503','#d1c6ac','#2a273e','#b9dee1'],
['#d25fbe','#428fb1','#8a6ec6','#d9c3e6','#0d0b05'],
['#9d1904','#d25fbe','#2f6691','#d9c3e6','#8a6ec6']
createCanvas(windowWidth, windowHeight);
f=createGraphics(width, height);
for(let x=0; x<width; x++){
for(let y=0; y<height; y+=floor(random(0, 5))){
var index = (x + y * width)*4;
let xer=map(abs(x-width/2), 0, width/2, 0, 100)
let yer=map(abs(y-height/2), 0, height/2, 0, 100)
let nvalue= map(noise(x/180, y/180), 0, 1, 0, 50)
let avalue= (xer+yer+nvalue)/2;
f.pixels[index+3]= avalue;
transfer= createGraphics(width, height)
for(let x=0; x<=width+gridSize; x+=gridSize){
for(let y=0; y<=height+gridSize; y+=gridSize){
droppers.push(new griddrop(x, y, gridSize, gridSize))
for(let i=droppers.length-1; i>=0; i--){
this.pos= createVector(x+w/2, y+h/2)
this.acc= createVector(0, 0)
this.vel= createVector(0, 0.1)
this.countdown= map(noise(this.pos.x/5, this.pos.y/10), 0, 1, 0, 800)
this.part=get(x, y, w, h)
this.rotSpeed=map(noise(this.pos.x/100, this.pos.y/100), 0, 1, -0.02, 0.02)
translate(this.pos.x, this.pos.y)
if(this.pos.y-gridSize>height){
let index = droppers.indexOf(this);
droppers.splice(index, 1);
transfer.fill(random(colors))
for (let i = -HALF_PI; i < TWO_PI; i += TWO_PI / 6) {
transfer.vertex(cos(i) * r, sin(i) * r)
let cArray=floor(random(5))
transfer.background(colors[0])
let gScale= floor(random(1, 5))
for(let x=0; x<width+gridSize; x+=gridSize){
for(let y=0; y<height+gridSize; y+=gridSize){
transfer.ellipse(x, y, gridSize, gridSize/2)
transfer.ellipse(x, y, gridSize/2, gridSize)
transfer.ellipse(x, y, gridSize/3, gridSize/3)
transfer.ellipse(x-gridSize/2, y-gridSize/2, gridSize/4)
transfer.ellipse(x-gridSize/2, y+gridSize/2, gridSize/4)
transfer.ellipse(x+gridSize/2, y-gridSize/2, gridSize/4)
transfer.ellipse(x+gridSize/2, y+gridSize/2, gridSize/4)