a = Canvas() myColors = [] myColors[0] = Color({ r:148, g:17, b:86 }) //or h,s,v myColors[1] = Color({ r:132, g:222, b:138 }) myColors[2] = Color({ r:54, g:72, b:248 }) a.draw = function(){ a.clear() for(index = 0; index < 10; index++){ randX = Math.random()*400 randY = Math.random()*200 a.circle(a.center.x + randX + 200, a.center.y + randY, 100) //randColor = Math.floor(Math.random()*2.999) // range 0 to 2 randNum = Math.random() //range 0 to 1 floating point if(randNum > 0.9) a.fill(myColors[2].rgbString()) else if(randNum > 0.8) a.fill(myColors[1].rgbString()) else a.fill(myColors[0].rgbString()) } }