def get_distance_meter_color(distance):
    """
    Function transforms the normalized distance of two points into a RGB color.
    This color is interpolated between Green (0, 255, 0) through Yellow (255, 255, 0) to Red (255, 0, 0).

    :param distance: Normalized distance between GT and prediction, in range (0, 1).

    :return: (R, G, B) representation of the distance.
    """

    R, G, B = 0.0, 0.0, 0.0

    '''From Green to Yellow for the first half.'''
    if 0 <= distance < 0.5:
        G = 1.0
        R = 2 * distance

    '''From Yellow to Red in the second half.'''
    if 0.5 <= distance <= 1:
        R = 1.0
        G = 1.0 - 2 * (distance - 0.5)

    return R, G, B