pKa/analyse_pKa_values.py
def scale_colour(self,value):
        """Scale a colour on our ramp"""
        if value is None:
            return 'black'
        import numpy
        value=min(self.val_max,value)
        value=max(self.val_min,value)
        if value<self.val_mid:
            colour=(value-self.val_min)/(self.val_mid-self.val_min)*(self.col_mid-self.col_min)+self.col_min
        else:
            value=abs(value)
            colour=(value-self.val_mid)/(self.val_max-self.val_mid)*(self.col_max-self.col_mid)+self.col_mid
        return self.colour_2_hex(colour)
Scale a colour on our ramp
Scale a colour on our ramp
Scale a colour on our ramp
def scale_colour(self,value):
        if value is None:
            return 'black'
        import numpy
        value=min(self.val_max,value)
        value=max(self.val_min,value)
        if value<self.val_mid:
            colour=(value-self.val_min)/(self.val_mid-self.val_min)*(self.col_mid-self.col_min)+self.col_min
        else:
            value=abs(value)
            colour=(value-self.val_mid)/(self.val_max-self.val_mid)*(self.col_max-self.col_mid)+self.col_mid
        return self.colour_2_hex(colour)
def scale_colour ( self , value ) : if value is None : return 'black' import numpy value = min ( self . val_max , value ) value = max ( self . val_min , value ) if value < self . val_mid : colour = ( value - self . val_min ) / ( self . val_mid - self . val_min ) * ( self . col_mid - self . col_min ) + self . col_min else : value = abs ( value ) colour = ( value - self . val_mid ) / ( self . val_max - self . val_mid ) * ( self . col_max - self . col_mid ) + self . col_mid return self . colour_2_hex ( colour )
Scale a colour on our ramp
Scale a colour on our ramp
"""Scale a colour on our ramp"""
self
value