next up previous contents index
Next: How to Change Up: How to ... Previous: How to ...

How to Colour atoms

We define the default colours used in O with the names used by the X-window system. A full listing can be produced by issuing the following command

 
paint_colo ?

The default red/green/blue name and mixtures are taken from Xlib Programming Manual, written by A.Nye, published by O'Reilly &Associates, page 185.

Colouring of atoms in O is controlled by the Paint commands. If the user does not specify any colouring, the program decides itself that you want to see atom colouring (i.e. based on the atomic number of the atom) using a particular set of colours.

Some commands affect an object that has already been created. This implies that some colour has already been used in the object creation creation. These object oriented commands ( Paint_object, Paint_obj_zon, Paint_obj_atom) re-colour the object with the colour currently specified in the data-base as a colour code in the datablock .active_colour. This can be reset with the Paint_colour command.

The other Paint commands modify a datablock that is an atomic property associated with a particular molecule. This property is called a27_atom_colour for a molecule called a27. If it does not exist, it will be created by the program with default colours. This datablock contains integer colouring codes, the RGB triplets are packed into a byte each. When a new molecular object is created (i.e. at the moment the End_object command is issued), the atoms are coloured with whatever is defined in the data block.

Skeleton atoms are in practise treated a bit differently. Their status codes are mapped to the colours defined in the datablock .bones_colour (they can also be Paint'ed but don't confuse yourself).