Skip to content

Instantly share code, notes, and snippets.

@bookercodes
Created June 19, 2016 19:25
Show Gist options
  • Save bookercodes/01dc87388facf9e24230cfa7d87fab7f to your computer and use it in GitHub Desktop.
Save bookercodes/01dc87388facf9e24230cfa7d87fab7f to your computer and use it in GitHub Desktop.
const getRandomInt = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min
const getRandomPastelColor = () => {
const redHex = (getRandomInt(0, 128) + 127).toString(16)
const greenHex = (getRandomInt(0, 128) + 127).toString(16)
const blueHex = (getRandomInt(0, 128) + 127).toString(16)
return `#${redHex}${greenHex}${blueHex}`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment