def hue(p):
    """
    Returns the saturation of a pixel.
    Gray pixels have saturation 0.
    :param p: A tuple of (R,G,B) values
    :return: A saturation value between 0 and 360
    """
    min_c = min(p)
    max_c = max(p)
    d = float(max_c - min_c)
    if d == 0:
        return 0

    if max_c == p[0]:
        h = (p[1] - p[2]) / d
    elif max_c == p[1]:
        h = 2 + (p[2] - p[0]) / d
    else:
        h = 4 + (p[0] - p[1]) / d
    h *= 60
    if h < 0:
        h += 360
    return h
def hue ( p ) : min_c = min ( p ) max_c = max ( p ) d = float ( max_c - min_c ) if d == 0 : return 0 if max_c == p [ 0 ] : h = ( p [ 1 ] - p [ 2 ] ) / d elif max_c == p [ 1 ] : h = 2 + ( p [ 2 ] - p [ 0 ] ) / d else : h = 4 + ( p [ 0 ] - p [ 1 ] ) / d h *= 60 if h < 0 : h += 360 return h
Returns the saturation of a pixel.
    Gray pixels have saturation 0.
    :param p: A tuple of (R,G,B) values
    :return: A saturation value between 0 and 360