From f65d71b8c74dd97de726123dc9282600a6a787c0 Mon Sep 17 00:00:00 2001 From: Brian Mullin Date: Wed, 31 May 2017 14:26:00 -0400 Subject: [PATCH] Finished Lab --- js/colors.js | 23 ++++++++++++----------- js/index.js | 6 +++--- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/js/colors.js b/js/colors.js index 6e4f350..df4d01c 100644 --- a/js/colors.js +++ b/js/colors.js @@ -1,5 +1,5 @@ -var colorsArray : { - colors=[ +var colorsArray = { + "colors" : [ { "name":"green", "red":"64", @@ -13,11 +13,11 @@ var colorsArray : { "blue":"62" }, { - name:"red", - red:"192", - green:"46", - blue:"35" - } + "name":"red", + "red":"192", + "green":"46", + "blue":"35" + }, { "name":"blue", "red":"19", @@ -25,9 +25,10 @@ var colorsArray : { "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..cff723e 100644 --- a/js/index.js +++ b/js/index.js @@ -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; @@ -136,4 +136,4 @@ window.onload = function() //set interval so we can draw then update our drawing // every 30 milisecond setInterval(draw,30); -} \ No newline at end of file +}