import colorsys


def change_lightness_color(color, factor: float):
    """
    Darken or lighten a RGB color according to factor.

    @Params:
    -------
    color (Tuple[R,G,B]):
        a tuple of RGB color.
    factor (float):
        If factor < 1, then the lightened color is returned, otherwise
        the darkened color is returned.
    """
    h, l, s = colorsys.rgb_to_hls(*color)
    return colorsys.hls_to_rgb(h, 1 - factor * (1 - l), s)