Skip to content

Instantly share code, notes, and snippets.

@MAKIO135
Last active March 31, 2019 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MAKIO135/ec761bad0f5e7bfb19f46d45ba0b3355 to your computer and use it in GitHub Desktop.
Save MAKIO135/ec761bad0f5e7bfb19f46d45ba0b3355 to your computer and use it in GitHub Desktop.
const hexToRgb = hex => {
hex = parseInt(hex[0] != '#' ? hex : hex.substring(1), 16)
return [
hex >> 16 & 255,
hex >> 8 & 255,
hex & 255
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment