Skip to content

Instantly share code, notes, and snippets.

@Klustre
Created June 8, 2019 07:59
Show Gist options
  • Save Klustre/66781e81c76a2b129ddeb3e5b282ddad to your computer and use it in GitHub Desktop.
Save Klustre/66781e81c76a2b129ddeb3e5b282ddad to your computer and use it in GitHub Desktop.
Generate Random RGB Value
/*
* Create a random RGB value.
* (c) 2009 Paul Irish, CCO License - http://creativecommons.org/publicdomain/zero/1.0/
* https://www.paulirish.com/2009/random-hex-color-code-snippets/
* @return {String} A random six-digit RGB hexcode
*/
const getRandomRGB = function () {
return '#' + Math.floor(Math.random() * 16777215).toString(16)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment