def rgb_tuple_from_csv(text: str):
    """
    Returns a three-valued tuple, each in the range 0-255, from comma-
    separated text.
    """
    values = text.split(",")
    if len(values) != 3:
        raise ValueError("Not a tuple of length 3")
    values = [int(v) for v in values]
    for v in values:
        if not (0 <= v <= 255):
            raise ValueError("Value not in range 0-255")
    return tuple(values)