import typing


def clamp(source: typing.Tuple[int, int, int]) -> typing.Tuple[int, ...]:
    """Helper for clamping rgb values

    Args:
        source (Tuple[int, int, int]): values to be clamped

    Returns:
        value (Tuple[int, int, int]): clamped values
    """
    return tuple(max(0, min(value, 255)) for value in source)