import colorsys


def scale_lightness(rgb, scale_l):
    """
    Scales the lightness of a color. Takes in a color defined in RGB, converts to HLS, lightens
    by a factor, and then converts back to RGB.
    """
    # converts rgb to hls
    h, l, s = colorsys.rgb_to_hls(*rgb)
    # manipulates h, l, s values and returns as rgb
    return colorsys.hls_to_rgb(h, min(1, l * scale_l), s = s)