diff --git a/script.js b/script.js index 01ff39e..78e4212 100644 --- a/script.js +++ b/script.js @@ -51,7 +51,9 @@ function getGridDimensions() { function colorGrid() { if (isRgb) { - this.style.background = rgbColor(); + this.style.background = randomizeColor(); + } else if (isTint) { + } else { this.style.background = colorValue; } @@ -66,6 +68,12 @@ function changeColor() { isRgb = false; } + if (buttonID === "tint") { + isTint = true; + } else { + isTint = false + } + switch (buttonID) { case "whiteColor": colorValue = "white"; @@ -88,7 +96,7 @@ function changeColor() { } } -function rgbColor() { +function randomizeColor() { let r = Math.floor(Math.random() * 255); let g = Math.floor(Math.random() * 255); let b = Math.floor(Math.random() * 255);