Package schrodinger :: Package application :: Package bioluminate :: Package patch_utils :: Module settings :: Class PatchSettings
[hide private]
[frames] | no frames]

Class PatchSettings

object --+
         |
        PatchSettings

Settings for all patch types (i.e. hydrophobic, positive, and negative).

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
tuple
color(self, patch_type)
Get the color for the specified patch type
tuple
fontColor(self, patch_type)
Get the font color for the specified patch type.
tuple
wsLabelColor(self, patch_type)
Get the workspace label color for the specified patch type.
bool
sameSizeAndThreshold(self, other)
Check to see if this object and other have the same patch size and patch threshold settings.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  DEFAULT_TRANSPARENCY = 15
float EP = 1e-07
A very small value (i.e.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

color(self, patch_type)

 

Get the color for the specified patch type

Parameters:
  • patch_type (PatchType) - The patch type to get the color for
Returns: tuple
The requested color as a tuple of integer (r, g, b) values

fontColor(self, patch_type)

 

Get the font color for the specified patch type. The font color will be either black or white, whichever is more readable against the current color setting for the specified patch type.

Parameters:
  • patch_type (PatchType) - The patch type to get the font color for
Returns: tuple
The font color as a tuple of integer (r, g, b) values

Note: The font color is calculated by determining the luma value of the patch color. If the luma is greater than 50% (i.e. closer to white than black), then a black font color is used. If the luma is less than 50% (i.e. closer to black than white), then a white font color is used. See http://24ways.org/2010/calculating-color-contrast/ and http://www.w3.org/TR/AERT#color-contrast for additional information.

wsLabelColor(self, patch_type)

 

Get the workspace label color for the specified patch type. The label color will be a darker version of the patch color. That way, the labels are readable against the protein surface.

Parameters:
  • patch_type (PatchType) - The patch type to get the workspace label color for
Returns: tuple
The color as a tuple of integer (r, g, b) values

sameSizeAndThreshold(self, other)

 

Check to see if this object and other have the same patch size and patch threshold settings. Differences in color are ignored.

Parameters:
Returns: bool
True if these objects have the same size and threshold settings. False otherwise.

Class Variable Details [hide private]

EP

A very small value (i.e. epsilon) used for floating point comparisons in sameSizeAndThreshold.
Type:
float
Value:
1e-07