Created
November 16, 2019 01:10
-
-
Save richardnfag/6dbd4d65f8cc05990ab5738f933c4d52 to your computer and use it in GitHub Desktop.
Python RGB Value to Hex Code
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 rgb_to_hex(rgb): | |
return ''.join(list( | |
map( | |
lambda x: format(int(x), '02X'), | |
rgb.split(',') | |
) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment