(self, values)
return results[0] if single else results
Return RGB tuple that matches `value`, which is assumed
        to lay within [0, 1].
Return RGB tuple that matches `value`, which is assumed
        to lay within [0, 1].
Return RGB tuple that matches value which is assumed to lay within [ 0 1 ] .
def getRGB(self, values):
        """
        Return RGB tuple that matches `value`, which is assumed
        to lay within [0, 1].
        """
        values, single = (np.array([values]), True) \
            if isinstance(values, Number) else (values, False)
        values = np.clip(values, 0, 1 - EPS)
        bin = np.digitize(values, self.bins)
        nans = bin >= len(self.bins)
        values[nans] = bin[nans] = 0  # just so that the next two lines pass
        p = (values - self.bins[bin - 1]) / self.deriv
        results = np.round((1 - p) * self.colors[bin - 1].T + p * self.colors[bin].T).T.astype(int)
        results[nans] = NAN_GREY
        return results[0] if single else results
def getRGB ( self , values ) : values , single = ( np . array ( [ values ] ) , True ) if isinstance ( values , Number ) else ( values , False ) values = np . clip ( values , 0 , 1 - EPS ) bin = np . digitize ( values , self . bins ) nans = bin >= len ( self . bins ) values [ nans ] = bin [ nans ] = 0 # just so that the next two lines pass p = ( values - self . bins [ bin - 1 ] ) / self . deriv results = np . round ( ( 1 - p ) * self . colors [ bin - 1 ] . T + p * self . colors [ bin ] . T ) . T . astype ( int ) results [ nans ] = NAN_GREY return results [ 0 ] if single else results