#NEWLINE# @ classmethod #NEWLINE# def __call__( cls , * args ) : #NEWLINE# #INDENT# '\n        Convert colors.\n\n        Return:\n          hue = [0, 360]\n          saturation = [0, 1]\n          value =[0, 1]\n        ' #NEWLINE# ( r , g , b , mode ) = cls . _args_to_vectors ( b ) #NEWLINE# M = np . maximum ( r , np . maximum ( g , b ) ) #NEWLINE# m = np . minimum ( r , np . minimum ( g , b ) ) #NEWLINE# C = ( M - m ) #NEWLINE# h = np . zeros_like ( C ) #NEWLINE# i = ( M == r ) #NEWLINE# h [ i ] = np . mod ( ( ( g [ i ] - b [ i ] ) / C [ i ] ) , 6 ) #NEWLINE# i = ( M == g ) #NEWLINE# h [ i ] = ( ( ( b [ i ] - r [ i ] ) / C [ i ] ) + 2 ) #NEWLINE# i = ( M == b ) #NEWLINE# h [ i ] = ( ( ( r [ i ] - g [ i ] ) / C [ i ] ) + 4 ) #NEWLINE# H = ( h * 60 ) #NEWLINE# V = M #NEWLINE# S = np . zeros_like ( C ) #NEWLINE# i = ( C != 0 ) #NEWLINE# S [ i ] = ( C [ i ] / V [ i ] ) #NEWLINE# return cls . _vectors_to_return ( H , S , V , mode )