Last active
November 21, 2017 21:57
-
-
Save RinatValiullov/a39cd3d3804c53038d4f638f7d2166e6 to your computer and use it in GitHub Desktop.
Convert Hexidecimal to RGB value(for colors)
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
let HEX_to_RGB = (hex) => { | |
let r = hex.substr(0,2), | |
g = hex.substr(2,2), | |
b = hex.substr(4,2); | |
return { | |
r: parseInt(r, 16), | |
g: parseInt(g, 16), | |
b: parseInt(b, 16) | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment