on
off
The logical (or boolean) explicit values are used to set some parameters and in a few commands.
" string-contents "
String values are used in the label command, the read command and a few others. A string value is enclosed by double-quote '"' characters. It cannot contain the newline character (line breaks), which means that a string cannot be split into more than one line in the input file. The maximum length of a string is currently 2047 characters. Currently, there is no way to include the double-quote character '"' itself in a string.
identifier
As a special case, a string which contains no blank characters, such as tabs or spaces, may be used without the double-quotes. This kind of string is called an identifier. There are several restrictions on it: there must be no blank characters in it, it must not contain characters that are special in a MolScript input file (semi-colon ';', curly brackets '{' '}'), and it cannot be equal to a command keyword. Typically, file names are identifiers.
1.2
0.3e1
-1.44E1
-1000
Some invalid numbers:
.2
1E2
Note that in contrast to previous versions of
MolScript (v1.4 and older), it is now allowed to give an integer value
when a floating-point value is expected. The integer is automatically
converted into a floating-point value. However, when an integer is
expected, a floating point value is invalid.
position
given with
an atom selection.
A vector specified by explicit x, y and z values, is given by three
numbers without separating commas. For example, the
labeloffset parameter is a vector
parameter, so to change it give the following command:
set labeloffset 0 0.5 -0.8;
The values in a vector must be valid numbers.
position
atom-selection
A vector may be specified by giving an atom selection after the keywordposition
. This will compute the geometrical centre-of-gravity of the atoms as the vector value. All atoms in the selection have the same weight. Note that in the transform command, this computation is done before any of the transformations have been applied.Note that the atom selection must contain at least one atom, or an error will result.
The colour system within MolScript unfortunately cannot guarantee that the appearance of a given colour specification will be the same in different output formats when displayed on different hardware.
The value in the greyscale specification ranges from 0.0 (black) to 1.0 (white), inclusive.
The values in the RGB specification denote the amount of red, green and blue, respectively, colour components to use in the colour. Each value ranges from 0.0 to 1.0, inclusive.
The values in the HSB specification denote the hue, saturation and brightness values for a colour. These values must all be within the range from 0.0 to 1.0, inclusive.
- The hue is defined in a circle-like fashion from 0.0 = red, 0.2 = yellow, 0.333 = green, 0.667 = blue, 0.8 = violet, 1.0 = red again.
- The saturation can be described as the whiteness of the colour, where 0.0 is completely white and 1.0 is full colour.
- The brightness (loosely, intensity) goes from 0.0 = black to 1.0 = full intensity.
colour name | colour specification |
---|---|
black
|
grey 0
|
white
|
grey 1
|
red
|
rgb 1 0 0
|
yellow
|
rgb 1 1 0
|
green
|
rgb 0 1 0
|
cyan
|
rgb 0 1 1
|
blue
|
rgb 0 0 1
|
purple
|
rgb 1 0 1
|
The ramp is defined by the two end-point colours. The actual result is crucially dependent on the colour space in which the ramp is defined. This is determined by the colourramp parameter. The reason for this is that the ramp is computed by linear interpolation of each colour component in the end-point colours. When the interpolation is done using the red, green and blue components (RGB), the result will be different compared to an interpolation using the hue, saturation, brightness components (HSB) even though the two end-point colours have the same visual appearance.
The HSB colour space is conceptually a
colour-wheel. It is therefore possible to interpolate in two opposite
directions in the HSB colour space. The
hsbreverseramp parameter
determines which direction is used. If the two end-point colours are
hsb 0 1 1
(red) and hsb 0.667 1
1
(blue), then interpolation with hsbreverseramp
off
(the default) will be in the forward direction, and will go
through hsb 0.333 1 1
(green). If the parameter is
on
, then the interpolation will instead go through
hsb 0.8 1 1
(purple).
Note that it does not matter which colour space is used in the specifications for the ramp end-point colours. The interpolation is determined by the colourramp and hsbreverseramp parameters, not by how the end-point colours are specified.
from colour-specification
to colour-specification
Defines the colour ramp by two explicit end-point colour
values. The lower end of the colour ramp is given by the first
colour. The interpolation calculation is affected by the
colourramp parameter, and if this
parameter is hsb
, then the
hsbreverseramp parameter also
comes into play.
rainbow
This defines a colour ramp in the HSB colour space from blue to red via cyan, green, and yellow, i.e. in the reverse direction.Note that, currently, this colour ramp specification will automatically set the colourramp parameter to
hsb
and the hsbreverseramp parameter toon
. This is really a bug.