xxxxxxxxxx
56
//Exploding Colors
//Created by Mirette Dahab
//September 5th, 2023
//independant work
function setup() {
createCanvas(400, 400);
}
function draw() {
background(12,55,100);
//creating the dynamic blue-black diagonally-lined background
for(let i = 1; i<width; i += 10){
for(let j = 1; j< height; j+= 10){
stroke(0);
frameRate(5);
strokeWeight(random(5));
line(i,j,i+10,j+10);
}
}
//creating the dynamic color wheel
translate(width/2, height/2); // to center the color wheel in the middle of the canvas
for (let z = 0 ; z < 2000;z++){
let i = random(mouseX+50);
let j = random(mouseY);
let k = random(mouseX);
let l = random(mouseY);
//creating an array of colors to be randomly chosen from
let y = color(255, 255, 119);
let bl = color(171, 255, 255);
let gr = color(144, 251, 120);
let br = color(94, 25, 0);
let r = color(248, 40, 22);
let p = color(96, 35, 250);
//randomly choosing an index for the array
let f = int(random(5));
let arraycolors = [y, bl, gr, r, p, br];
stroke(arraycolors[f])
rotate(random(60));
strokeWeight(random(2));
line(i,j,k,l);
}
}