Skip to content

Instantly share code, notes, and snippets.

@halm
Last active December 24, 2015 08:48
Show Gist options
  • Select an option

  • Save halm/6772547 to your computer and use it in GitHub Desktop.

Select an option

Save halm/6772547 to your computer and use it in GitHub Desktop.
Convert RGB to hex.
rgb = ((99,170,254), (221,8,6), (153,204,0), (31,183,20), (255,124,128),
(134,83,87), (204,204,255), (0,0,144), (204,153,255), (255,0,255),
(252,243,5), (255,153,0), (70,0,165), (128,0,0), (0,0,212),
(0,204,255))
for c in rgb:
h = "{0:02x}{1:02x}{2:02x}".format(*c)
print( h+','),
print('')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment