#36 Done

Ouvert
natehalldev veut fusionner 1 révision(s) depuis natehalldev/JSON-Lab-1:master vers master
2 fichiers modifiés avec 14 ajouts et 13 suppressions
  1. 13
    12
      js/colors.js
  2. 1
    1
      js/index.js

+ 13
- 12
js/colors.js Voir le fichier

1
-var colorsArray : {
2
-    colors=[
1
+var colorsArray = {
2
+    colors: [
3
         {
3
         {
4
             "name":"green",
4
             "name":"green",
5
             "red":"64",
5
             "red":"64",
13
             "blue":"62"
13
             "blue":"62"
14
         },
14
         },
15
         {
15
         {
16
-            name:"red",
17
-            red:"192",
18
-            green:"46",
19
-            blue:"35"
20
-        }
16
+            "name":"red",
17
+            "red":"192",
18
+            "green":"46",
19
+            "blue":"35"
20
+        },
21
         {
21
         {
22
             "name":"blue",
22
             "name":"blue",
23
             "red":"19",
23
             "red":"19",
25
             "blue":"144",
25
             "blue":"144",
26
         },
26
         },
27
         {
27
         {
28
-            "name"="orange",
29
-            "red"="253",
30
-            "green"="92",
31
-            "blue"="48"
32
-        },
28
+            "name":"orange",
29
+            "red":"253",
30
+            "green":"92",
31
+            "blue":"48"
32
+        }
33
     ]
33
     ]
34
+}

+ 1
- 1
js/index.js Voir le fichier

39
 		this.g = Math.round(Math.random()*255);
39
 		this.g = Math.round(Math.random()*255);
40
 		this.b = Math.round(Math.random()*255);*/
40
 		this.b = Math.round(Math.random()*255);*/
41
 
41
 
42
-		this.randomColor = randomInt(0,colorsArray.colors.length-1);
42
+		this.randomColor = randomInt(0, colorsArray.colors.length-1);
43
 		this.r = colorsArray.colors[this.randomColor].red;
43
 		this.r = colorsArray.colors[this.randomColor].red;
44
 		this.g = colorsArray.colors[this.randomColor].green;
44
 		this.g = colorsArray.colors[this.randomColor].green;
45
 		this.b = colorsArray.colors[this.randomColor].blue;
45
 		this.b = colorsArray.colors[this.randomColor].blue;