loading...

re: Generate and Set Pseudorandom Hexadecimal Background Color Using JavaScript VIEW POST

FULL DISCUSSION
 
function generateRandomHexColor() {
  const rgb = () => ('0' + (Math.random() * 256).toString(16)).slice(-2);
  return `#${rgb()}${rgb()}${rgb()}`;
}
code of conduct - report abuse