from typing import Tuple


def hex_to_rgb(hex_value: str) -> Tuple[int, int, int]:
    """
    Converts a valid hexadecimal color string given by '#XXXXXX' to a tuple representing RGB values.
    If the string representation does not match the above description, a ValueError is raised.
    :param hex_value: String representation of hexadecimal color.
    :return: Tuple of RGB color values: (R,G,B)
    """
    if len(hex_value) != 7 or hex_value[0] != "#":
        raise ValueError(
            "the color has to be specified by '#XXXXXX'. Invalid value %s" % hex_value
        )
    hex_value = hex_value.lstrip("#")
    try:
        int(hex_value, 16)
    except ValueError:
        raise ValueError(
            "the color value has to be a valid hexadecimal number. Invalid value %s"
            % hex_value
        )
    return int(hex_value[0:2], 16), int(hex_value[2:4], 16), int(hex_value[4:6], 16)