Created
March 5, 2019 16:35
-
-
Save theuves/0ffaf6d8909abe402cff3e2e84d96616 to your computer and use it in GitHub Desktop.
Gambiarra interessante para converter cor hexadecimal para RGB.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hex2rgb = colorHex => eval(colorHex.replace(/^#?(.{2})(.{2})(.{2})$/, '({r:0x$1,g:0x$2,b:0x$3})')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment