const randomHexColour = (function() {
const hexValues = "123456abcdef";
return function() {
let hexString = "";
for (let i = 0; i < 6; i++) {
hexString += hexValues[Math.floor(Math.random() * hexValues.length)];
}
return "#" + hexString;
}
})();
function randomRGBColour(alpha = false) {
if (alpha) {
return "rgba(" + Math.floor(Math.random() * 256) + ", " + Math.floor(Math.random() * 256) + ", " + Math.floor(Math.random() * 256) + ", " + Math.random() + ")";
}
return "rgb(" + Math.floor(Math.random() * 256) + ", " + Math.floor(Math.random() * 256) + ", " + Math.floor(Math.random() * 256) + ")";
}