Skip to content

Instantly share code, notes, and snippets.

@PJB3005
Created August 12, 2017 10:25
Show Gist options
  • Save PJB3005/9003eb591ed54284eadcb884e3fdf2db to your computer and use it in GitHub Desktop.
Save PJB3005/9003eb591ed54284eadcb884e3fdf2db to your computer and use it in GitHub Desktop.
import colorsys
from random import randint
for x in range(10):
h = randint(0, 360)
s = randint(0, 100)
l = randint(0, 100)
r, g, b = colorsys.hls_to_rgb(h/360, l/100, s/100)
r = round(r * 255)
g = round(g * 255)
b = round(b * 255)
print(f"({h}, {s}, {l}, new Color({r}, {g}, {b})),")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment