Skip to content

Instantly share code, notes, and snippets.

@sangwin
Created July 18, 2022 09:11
Show Gist options
  • Save sangwin/cce8fd2a35638b63218bc4ee6bf7942c to your computer and use it in GitHub Desktop.
Save sangwin/cce8fd2a35638b63218bc4ee6bf7942c to your computer and use it in GitHub Desktop.
Generate a random color with JavaScript one liner function
const randomColor = () => `#${Math.floor(Math.random() * 0xffffff).toString(16)}`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment