import colorsys


def scale_lightness(rgb, scale_l):
    """
    Scales lightness of color `rgb`
    https://stackoverflow.com/a/60562502/3413239
    """
    # convert rgb to hls
    h, l, s = colorsys.rgb_to_hls(*rgb)
    # manipulate h, l, s values and return as rgb
    return colorsys.hls_to_rgb(h, min(1, l * scale_l), s = s)