from typing import Tuple
import math


def color_difference_redmean(
    rgb1: Tuple[float, float, float], rgb2: Tuple[float, float, float]
) -> float:
    """Distance between colors in RGB space (redmean metric).

    The maximal distance between (255, 255, 255) and (0, 0, 0) ≈ 765.

    Sources:
    - https://en.wikipedia.org/wiki/Color_difference#Euclidean
    - https://www.compuphase.com/cmetric.htm
    """
    r_hat = (rgb1[0] + rgb2[0]) / 2
    delta_r, delta_g, delta_b = [(col1 - col2) for col1, col2 in zip(rgb1, rgb2)]
    red_term = (2 + r_hat / 256) * delta_r ** 2
    green_term = 4 * delta_g ** 2
    blue_term = (2 + (255 - r_hat) / 256) * delta_b ** 2
    return math.sqrt(red_term + green_term + blue_term)