Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions js/colors.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var colorsArray : {
colors=[
var colorsArray = {
"colors" : [
{
"name":"green",
"red":"64",
Expand All @@ -13,21 +13,22 @@ var colorsArray : {
"blue":"62"
},
{
name:"red",
red:"192",
green:"46",
blue:"35"
}
"name":"red",
"red":"192",
"green":"46",
"blue":"35"
},
{
"name":"blue",
"red":"19",
"green":"71",
"blue":"144",
},
{
"name"="orange",
"red"="253",
"green"="92",
"blue"="48"
"name":"orange",
"red":"253",
"green":"92",
"blue":"48"
},
]
};
6 changes: 3 additions & 3 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ window.onload = function()
this.height = 20;

//random colors for our box
/*this.r = Math.round(Math.random()*255);
this.r = Math.round(Math.random()*255);
this.g = Math.round(Math.random()*255);
this.b = Math.round(Math.random()*255);*/
this.b = Math.round(Math.random()*255);

this.randomColor = randomInt(0,colorsArray.colors.length-1);
this.r = colorsArray.colors[this.randomColor].red;
Expand Down Expand Up @@ -136,4 +136,4 @@ window.onload = function()
//set interval so we can draw then update our drawing
// every 30 milisecond
setInterval(draw,30);
}
}