xxxxxxxxxx
var cGreen = "#11524a"; //color green
var cGrey = "#0e100f"; //color grey
var cBlack = "#0000"; //color black
var cWhite = "#ffff"; //color white
var repx; //repeat for x-axis
var repy; //repeat for y axis
var colors = [cGrey, cGreen] //assign 2 colors for randomization
function setup() {
createCanvas(730, 730);
background(cWhite);
repx = 30; //define repeat value for x
repy = 30; //define repeat value for y
sz = 40; //maximum size
noLoop(); //disable loop
}
//function setColor() {
//randomColor = color(random(100, 256), random(100, 256), random(100, 256));
//first try to randomize circle colors but didnt work
//}
function draw() {
background(cWhite);
drawColumn(); //drawing circle
push(); //moving
translate(0,0); //moving
for(var c = 0; c < 24; c = c + 3){
for(var d = 0; d < 24; d = d + 3){
var color = random(colors); //randomize color of the circles
fill (color);
push(); //moving
translate(repx * c,repy * d); //moving
drawColumn(); //drawing circle
pop(); //moving
}
}
pop();
//for(var c = 0; c < 20; c = c + 1){
//greyCircle();
//}
}
function drawColumn() { //function to draw the circles
ellipse(50, 50, 60, 60);
//fill(cGreen);
noStroke();
}
function keyPressed () { //function to randomize every time key is pressed
draw();
}