Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save colorswall/106c4d6873141e246b80b35e230d041d to your computer and use it in GitHub Desktop.
Save colorswall/106c4d6873141e246b80b35e230d041d to your computer and use it in GitHub Desktop.
const getRandomArbitrary = (min, max) => parseInt(Math.random() * (max - min) + min, 10)
const generateRandomRGBColor = () =>
`rgb(${getRandomArbitrary(0, 255)}, ${getRandomArbitrary(0, 255)}, ${getRandomArbitrary(0, 255)})`;
// generateRandomRGBColor()
// Result rgb(101, 216, 215)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment