Module colour
[hide private]
[frames] | no frames]

Module colour

source code

Module for colour manipulation.

Functions [hide private]
float
linear_gradient(value, start, end, colour_list=None)
Return an RGB colour array of the value placed on a linear colour gradient.
source code
list of float
molmol_colours(name)
Return the RGB colour array corresponding to the Molmol colour name.
source code
list of float
x11_colours(name)
Return the RGB colour array corresponding to the X11 colour name.
source code
Variables [hide private]
  _linear_gradient_doc = ['Colour', '\n The values are co...
  __molmol_colours_prompt_doc__ = ['Molmol RGB colour arrays', '...
  __x11_colours_prompt_doc__ = ['X11 RGB colour arrays', '\n ...
  __package__ = None
hash(x)

Imports: float64, array, RelaxInvalidColourError


Function Details [hide private]

linear_gradient(value, start, end, colour_list=None)

source code 

Return an RGB colour array of the value placed on a linear colour gradient.

The argument value should be a number between zero and one. The start and end colours can either be strings or RGB colour arrays.

Parameters:
  • value (float) - The position on the gradient, ranging from zero to one.
  • start (str or list of float) - The starting colour, either the name of the colour as a string or an RGB colour array.
  • end (str or list of float) - The ending colour, either the name of the colour as a string or an RGB colour array.
  • colour_list (str) - The colour names to use, one of 'x11' or 'molmol'.
Returns: float
The position in the gradient.

molmol_colours(name)

source code 

Return the RGB colour array corresponding to the Molmol colour name.

Parameters:
  • name (str) - The Molmol colour name.
Returns: list of float
The RGB colour array.

x11_colours(name)

source code 

Return the RGB colour array corresponding to the X11 colour name.

Parameters:
  • name (str) - The X11 colour name, as defined in the /usr/X11R6/lib/X11/rgb.txt file.
Returns: list of float
The RGB colour array.

Variables Details [hide private]

_linear_gradient_doc

Value:
['Colour',
 '''
        The values are coloured based on a linear colour gradient whic\
h is specified through the starting and ending colours.  These can eit\
her be a string to identify one of the RGB (red, green, blue) colour a\
rrays listed in the tables below, or you can give the RGB vector itsel\
f.  For example, \'white\' and [1.0, 1.0, 1.0] both select the same co\
lour.  Leaving both colours unset will select the default colour gradi\
...

__molmol_colours_prompt_doc__

Value:
['Molmol RGB colour arrays',
 '''
        The following table is a list of colours used in Molmol and th\
eir corresponding RGB colour values ranging from 0 to 1.
        ______________________________________________________________\
_
        |                               |         |         |         \
|
...

__x11_colours_prompt_doc__

Value:
['X11 RGB colour arrays',
 '''
        The following table is the list of X11 colour names and their \
corresponding RGB colour values ranging from 0 to 255.
        ______________________________________________________________\
_
        |                               |         |         |         \
|
...