let sqr, pX, img, imgOver, bg, palette;
"https://coolors.co/f8f9fa-e9ecef-dee2e6-ced4da-adb5bd-6c757d-495057-343a40-212529",
"https://coolors.co/0f3375-13459c-1557c0-196bde-2382f7-4b9cf9-77b6fb-a4cefc-cce4fd-e8f3fe",
"https://coolors.co/ebe0ff-dac7ff-c7adff-ac8bee-916dd5-7151a9-573d7f-46325d-3f3649",
"https://coolors.co/eaf2e3-6c9d46-b7ee8c-a0db72-28321f",
"https://coolors.co/ff2c55-e2294f-c41e3d-7d1128-3c0919",
"https://coolors.co/05668d-028090-00a896-02c39a-f0f3bd",
"https://coolors.co/ff9f1c-ffbf69-ffffff-cbf3f0-2ec4b6",
"https://coolors.co/ff6d00-ff7900-ff8500-ff9100-ffc05c-240046-3c096c-5a189a-7b2cbf-c698eb",
"https://coolors.co/ffffff",
"https://coolors.co/331e36-41337a-6ea4bf-c2efeb-ecfee8",
"https://coolors.co/cdb4db-ffc8dd-ffafcc-bde0fe-a2d2ff",
"https://coolors.co/03071e-370617-6a040f-9d0208-d00000-dc2f02-e85d04-f48c06-faa307-ffba08",
"https://coolors.co/9b5de5-f15bb5-fee440-00bbf9-00f5d4",
"https://coolors.co/012a4a-013a63-01497c-014f86-2a6f97-2c7da0-468faf-61a5c2-89c2d9-a9d6e5",
"https://coolors.co/8d99ae-edf2f4-ef233c",
"https://coolors.co/ff7b00-ff8800-ff9500-ffa200-ffaa00-ffb700-ffc300-ffd000-ffdd00-ffea00"
img = loadImage('logo.png');
function getRandRange(a,b){
return getRand(b - a) + a;
num[0] = Math.floor(getRandRange(50,100));
function windowResized(){
sqr = Math.min(windowWidth, windowHeight);
createCanvas(sqr,sqr, P2D);
palette = createPalette(url[Math.floor(getRand(url.length))], 100);
bg = createGraphics(sqr,sqr);
imgOver = createGraphics(sqr,sqr);
bg.image(img,pX * sz,pX * sz,pX * (100 - (sz * 2)),pX * (100 - (sz * 2)));
let special = getRand(1.0) < 0.5 ? true : false;
let rt = (random() * 1.5) + 1.5;
let shp = (getRand(1.0) > 0.7);
for (let x = 0; x < sqr; x += (pX)){
for (let y = 0; y < sqr; y += (pX)){
let clr = palette[Math.floor(getRand(palette.length))];
particles.push(new Particle(x,y, rad, 50, palette[Math.floor(getRand(palette.length))]));
fill(0,255 - (frameCount - 255));
for(let i=particles.length-2; i>=0; i--) {
particles[i].update(particles);
if(particles[i].age > 255) particles.splice(i, 1);
constructor(x,y,r,a,clr){
this.location = createVector(x,y) ;
this.velocity = createVector(0,0);
this.acceleration = createVector();
if (this.age > 25) this.acceleration.add(createVector(getRandRange(-0.05,0.05),getRandRange(-0.05,0.05)));
this.velocity.add(this.acceleration);
this.acceleration.set(0,0);
this.location.add(this.velocity);
if(this.age > 80 && getRand(1.0) < 0.0005) {
p.push(new Particle(this.location.x, this.location.y, this.rad, this.palpha, this.drawClr));
let c = color(this.drawClr);
c.setAlpha(255 - this.age);
ellipse(this.location.x, this.location.y, this.rad);
function createPalette(_url, percent = 100) {
let slash_index = _url.lastIndexOf('/');
let pallate_str = _url.slice(slash_index + 1);
let arr = pallate_str.split('-');
for (let i = 0; i < arr.length; i++) {
arr[i] = color('#' + arr[i] + hex(int(percent / 100 * 255), 2));