Skip to content

Instantly share code, notes, and snippets.

@timtreis
Last active May 3, 2020 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timtreis/11402360b9b5df0e98f4c8b411672e10 to your computer and use it in GitHub Desktop.
Save timtreis/11402360b9b5df0e98f4c8b411672e10 to your computer and use it in GitHub Desktop.
Python helper functions
print("Successfully imported ttreis helper functions")
def rgb2hex(r,g,b):
return "#{:02x}{:02x}{:02x}".format(r,g,b)
somsault_1 = rgb2hex( 0, 0, 0) # black
somsault_2 = rgb2hex( 0, 73, 73) # dark grey
somsault_3 = rgb2hex( 0, 146, 146) #009999, approx. "Persian Green"
somsault_4 = rgb2hex(255, 109, 182)
somsault_5 = rgb2hex(255, 182, 119) # brown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment