Merge commit 'c3af251'

This commit is contained in:
Frank DeMarco 2019-08-21 19:43:23 -04:00
commit dc8eff2dd7
1 changed files with 6 additions and 0 deletions

View File

@ -252,3 +252,9 @@ def get_hsla_color(hue, saturation=100, lightness=50, alpha=100):
color = Color(0, 0, 0, 0)
color.hsla = hue % 360, saturation, lightness, alpha
return color
def get_random_hsla_color(hue_range=(0, 359), saturation_range=(0, 100),
lightness_range=(0, 100), alpha_range=(100, 100)):
return get_hsla_color(
randint(*hue_range), randint(*saturation_range), randint(*lightness_range),
randint(*alpha_range))