def interpolate(color_a, color_b, factor):
    """
    Interpolate between two colors be the given factor
    :param color_a: List or tuple of three value, red, green and blue
    :param color_b: List or tuple of three value, red, green and blue
    :param factor: Factor for interpolating between the two colors
    :return: Interpolated color
    """
    if len(color_a) != 3 or len(color_b) != 3:
        raise ValueError("Both color inputs need to contain three values for red, green and blue.")
    if factor < 0.0 or factor > 1.0:
        raise ValueError("The factor has to be within the [0.0, 1.0] range.")
    return [color_a[i] + (color_b[i] - color_a[i]) * factor for i in range(3)]