Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import colorsys
- def get_random_color():
- h,s,l = random.random(), 0.5 + random.random()/2.0, 0.4 + random.random()/5.0
- r,g,b = [int(256*i) for i in colorsys.hls_to_rgb(h,l,s)]
- person_color1 = '#%02x%02x%02x' % (r,g,b)
- person_color2 = "#" + "%06x" % random.randint(0, 0xFFFFFF)
- return [(r,g,b), person_color1], person_color2
- if __name__ == __main__:
- print (get_random_color())
Add Comment
Please, Sign In to add comment