#NEWLINE# @ classmethod #NEWLINE# def __call__( cls , * args ) : #NEWLINE# #INDENT# __doc__ = ColorModel . __call__ . __doc__ #NEWLINE# ( h , s , i , mode ) = cls . _args_to_vectors ( args ) #NEWLINE# np . mod ( h , 360.0 , out = h ) #NEWLINE# np . clip ( i , 0 , 1 , out = i ) #NEWLINE# np . clip ( s , 0 , 1 , out = s ) #NEWLINE# p = ( h / 60.0 ) #NEWLINE# f = ( 0.5 * np . mod ( p , 2.0 ) ) #NEWLINE# c = ( ( s * i ) * 3 ) #NEWLINE# x = ( c * ( 1 - f ) ) #NEWLINE# y = ( c * f ) #NEWLINE# z = np . zeros_like ( x ) #NEWLINE# m = ( i - ( i * s ) ) #NEWLINE# col = np . vstack ( ( x , y , z ) ) . transpose ( ) #NEWLINE# ip = np . int64 ( ( p / 2 ) ) #NEWLINE# rgb = col [ ( np . tile ( np . arange ( len ( x ) ) , ( 3 , 1 ) ) . transpose ( ) , cls . _perm [ ip ] ) ] #NEWLINE# rgb += m [ : , np . newaxis ] #NEWLINE# np . clip ( rgb , 0 , 1 , out = rgb ) #NEWLINE# return cls . _array_to_return ( rgb , mode )