from typing import Tuple


def confidence_to_rgb(confidence: float) -> Tuple[int, int, int]:
    """
    Interpolate between red and green based on
    confidence parameter <0, 1>.
    
    :param confidence: factor for choosing color between red and green
    :return: Tuple containing BGR code for color
    """

    if confidence <= 0.5:
        color_amount = int(confidence * 2 * 255)
        return 0, color_amount, 255
    else:
        color_amount = int((confidence - 0.5) * 2 * 255)
        return 0, 255, 255 - color_amount