function generateRandomHexColor(): string {
const hexChars = "0123456789ABCDEF";
let hex: string = "";
for (let i: number = 0; i < 6; i++) {
const index: number = Math.floor(Math.random() * 16);
hex += hexChars[index];
}
return hex;
}
const hexColor: string = generateRandomHexColor();
console.log(`Random HEX Color: #${hexColor}`);
/*
run:
"Random HEX Color: #00BAE8"
*/