def _adjust_component(comp):
    """Return comp as an integer between 0 and 255, inclusive, returning 0
    if comp is negative and capping values >= 256 at 255.
    """
    comp = int(comp)
    return max(0, min(255, comp))