Change rgb function name

This commit is contained in:
lolabird 2023-11-10 08:26:39 -07:00
commit b7666e1ca8

View file

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