def _relative_luminance(rgb: RGBColor) -> float:
    """
    Calculate the relative luminance of an RGB color.

    Parameters
    ----------
    rgb
        The RGB color.

    Returns
    -------
    float
        The relative luminance.
    """

    # Convert the RGB values to the sRGB color space
    srgb = [_srgb(x=x) for x in rgb]

    # Calculate the relative luminance
    relative_luminance = 0.2126 * srgb[0] + 0.7152 * srgb[1] + 0.0722 * srgb[2]

    return relative_luminance

    Calculate the relative luminance of an RGB color.

    Parameters
    ----------
    rgb
        The RGB color.

    Returns
    -------
    float
        The relative luminance.
    
great_tables/_data_color/base.py