Usage:
rangecolor attr_name[,b][,l][,s][,v][,r] color1 value1 color2 value2 [... colorN valueN] atom-spec

Rangecolor colors over a range according to the values of an attribute such as atomic B-factor or residue hydrophobicity. The attribute, which must be numerical, is specified by attr_name; it can be built-in (see the attribute lists for atoms, residues and molecule models) or custom (see Define Attribute).

Render by Attribute is a related tool that provides a graphical interface for coloring (and scaling atom and "worm" radii) by attribute values.

The optional specifiers b, l, s, v, and r designate atoms/bonds, atom labels, molecular surfaces, vdw surfaces, and ribbons, respectively. When b is used to indicate "bonds," in actuality the specified atoms are colored and the bonds merely reflect the color(s) of the atoms. In the absence of a specifier, atoms, atom labels, surfaces, and ribbons are all affected.

At least two color-name/value pairs must be supplied. Pairs do not need to be ordered by value. Each color name (color1, color2, etc.) can be a built-in name or a name defined previously with colordef. Values (value1, value2, etc.) can be specified directly or with the special words:

value indicator meaning
min minimum value
max maximum value
mid average of min and max
novalue no value assigned for the attribute

A pair specified with novalue does not contribute toward the minimum of two pairs because the corresponding color is not involved in any ranges; it is only used to color items with no value for the specified attribute (for example, nucleic acid residues do not have kdHydrophobicity values). When an atom attribute is used to color ribbons, the ribbon segment for each residue is colored according to the average of the values for atoms in the residue. In all cases, the reported min, mid, and max values describe the original attribute rather than any derived quantity such as an average.

The atom-spec indicates which atoms (and/or associated labels, surfaces, or ribbon) are to be colored. If no atom-spec is given, all atoms (and/or their associated labels, surfaces, or ribbon) are affected.

In Chimera, visible color is determined by a hierarchy. Rangecolor sets atom (label, surface) colors at the atom level and ribbon colors at the residue level.

Examples:

rangecol bfactor,s min blue 20 white 40 red
- color the molecular surface (only) by atomic B-factor, from blue for the minimum value, to white for 20, to red for 40 and above
range kdHydrophobicity min lime green max orange novalue magenta
- color from lime green to orange according to Kyte-Doolittle hydrophobicity; color any residues without hydrophobicity assignments magenta

See also: color, colordef, rainbow, ribcolor, Define Attribute, Render by Attribute