Created
June 26, 2019 01:16
-
-
Save dooyeoung/7a2e2bab4d00dd3940ff4ff41f6ed47e to your computer and use it in GitHub Desktop.
hex to rgb
This file contains 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
def hex2rgb(hexcode): | |
hexcode = hexcode.lstrip('#') | |
lv = len(hexcode) | |
return list(int(hexcode[i:i + lv // 3], 16) for i in range(0, lv, lv // 3)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment