Guest User

Untitled

a guest
Jul 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import random
  2. import colorsys
  3.  
  4. def get_random_color():
  5. h,s,l = random.random(), 0.5 + random.random()/2.0, 0.4 + random.random()/5.0
  6. r,g,b = [int(256*i) for i in colorsys.hls_to_rgb(h,l,s)]
  7. person_color1 = '#%02x%02x%02x' % (r,g,b)
  8. person_color2 = "#" + "%06x" % random.randint(0, 0xFFFFFF)
  9. return [(r,g,b), person_color1], person_color2
  10.  
  11. if __name__ == __main__:
  12. print (get_random_color())
Add Comment
Please, Sign In to add comment