Skip to content

Instantly share code, notes, and snippets.

@sudevschiz
Created November 27, 2019 06:38
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 sudevschiz/8736c7f6f7c0757be95c28481a33fb44 to your computer and use it in GitHub Desktop.
Save sudevschiz/8736c7f6f7c0757be95c28481a33fb44 to your computer and use it in GitHub Desktop.
Generate list of N random HEX values, which can be used as coloring palettes in plotting libaries
def rand_color_gen(n=1):
h_v = []
for i in range(0,n):
i+=1
r = lambda: random.randint(0,255)
h_v.append('#%02X%02X%02X' % (r(),r(),r()))
return h_v
# Just random colors. No guarantee of any sort.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment