diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/JSON-Lab-1.iml b/.idea/JSON-Lab-1.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/JSON-Lab-1.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..a5b9dac --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..797acea --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/js/colors.js b/js/colors.js index 6e4f350..63ef631 100644 --- a/js/colors.js +++ b/js/colors.js @@ -1,10 +1,10 @@ -var colorsArray : { - colors=[ +var colorsArray = [ + //colors=[ { "name":"green", "red":"64", "green":"175", - "blue":"63", + "blue":"63" }, { "name":"yellow", @@ -13,21 +13,21 @@ 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", + "blue":"144" }, { - "name"="orange", - "red"="253", - "green"="92", - "blue"="48" + "name":"orange", + "red":"253", + "green":"92", + "blue":"48" }, ] diff --git a/js/index.js b/js/index.js index 396b2e7..79ae7a0 100644 --- a/js/index.js +++ b/js/index.js @@ -17,7 +17,7 @@ window.onload = function() canvas.width = W; canvas.height = H; - //console.log("my color request: "+colorsArray); + console.log("my color request: "+colorsArray); /*===============Box class=================================*/ function Box(_x, _y) @@ -39,12 +39,12 @@ window.onload = function() this.g = 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; - this.g = colorsArray.colors[this.randomColor].green; - this.b = colorsArray.colors[this.randomColor].blue; + this.randomColor = randomInt(0,colorsArray.length-1); + this.r = colorsArray[this.randomColor].red; + this.g = colorsArray[this.randomColor].green; + this.b = colorsArray[this.randomColor].blue; - console.log(colorsArray); + //console.log(colorsArray); this.rgba = "rgba("+this.r+","+this.g+","+this.b+",1)";