The color command colors atomic models, including atoms, bonds, pseudobonds, cartoons, and molecular surfaces. It can also apply to nonmolecular surfaces, depending on the type of coloring:
See examples below. See also: transparency, mlp, surface, volume, Molecule Display Toolbar, initial colors, color names, palettes
Subcommands of color:
Usage: color spec colorname general-options
Simple coloring applies to atomic models, including cartoon and molecular surface representations, and volume data (map) displays. The colorname can be:
Usage: color atom-spec sequential level [ palette palette ] general-options
– or –
Usage: rainbow atom-spec [ level ] [ palette palette ] general-options
The sequential coloring method (synonym rainbow, see examples) applies a series of colors at the specified level:
Usage: color spec map map-model [ offset d ] palette-options general-options
Coloring by map value applies to surfaces only, both molecular and nonmolecular (such as volume isosurfaces). The color-value mapping is specified with palette options. The offset d is how far out from each surface vertex, along its normal, to evaluate the data (default 0.0 Å). An offset of 1.4 Å is typically used for coloring a molecular surface by electrostatic potential. The rationale for looking outward is that the values at the centers of any interacting atoms are more relevant than those at their surfaces. By default, a molecular surface shows where the surface of a spherical probe of radius 1.4 Å can lie, the solvent-excluded surface. An offset of 1.4 Å approximates the solvent-accessible surface, about as close as the probe center can get to the molecule.
Usage: color surf-model zone atom-spec [ distance cutoff ]
Coloring by zone to match nearby atoms or markers applies to nonmolecular surfaces only. The cutoff is specified in physical units of distance, typically Å (default 2.0). When multiple specified atoms fall within the cutoff distance of a surface vertex, the vertex will be colored to match the closest one. Vertices not within the cutoff of any of the atoms are assigned the default color of the surface model (single-color mode).
Specify coloring only a subset of the possible displays of a given atom, residue, etc. The string can be any combination of the following letters, without commas or spaces:
The default is all of the above (target abcsp), except that surface coloring is not yet implemented for sequential coloring (if atoms have been colored sequentially, however, the surface can be colored to match the atoms with the command: color fromatoms target s).
- a - atoms/bonds (coloring shown for bonds in halfbond mode)
- b - bonds-only (coloring shown for bonds not in halfbond mode)
- c or r - cartoons (ribbons) (divisible to per-residue segments)
- s - surfaces (molecular surfaces divisible to per-atom patches, other surface models such as volume isosurfaces, and for simple coloring only, solid volume displays)
- p - pseudobonds-only (coloring shown for pseudobonds not in halfbond mode)
Alternatively, for simple coloring only, a single target can be specified with a keyword immediately following the colorname:
- atoms - equivalent to target a
- bonds - equivalent to target b
- cartoons or ribbons - equivalent to target c or target r
- surfaces - equivalent to target s
- pseudobonds - equivalent to target p
halfbond true | false
By default, bonds are shown in halfbond mode, with color and transparency settings from the flanking atoms. Turning halfbond mode off for a bond (or pseudobond) reveals its own color/transparency settings independent of the atoms. This option can be used to toggle halfbond mode regardless of whether the command colors any bonds. It affects only the specified bonds (not pseudobonds), except obeying the target setting when it includes p.
Set transparency to the specified percent, where 0% is completely opaque and 100% is completely transparent. Existing transparency is not changed unless this option is used or the colorname explicitly specifies alpha (opacity). An alpha value overrides this option if both are given. Note that the transparency command can be used to set transparency apart from color.
A palette is an ordered set of colors or value,color pairs used for sequential coloring or coloring by map value.
Specify a palette as one of the following:
- palette-name - the name of an existing palette; the command palette list lists the names of the available palettes in the Log. Predefined palettes include the following, with colors shown in ascending value order:
- rainbow (default for sequential coloring)
- red-white-blue or redblue (default for map coloring)
- blue-white-red or bluered
- cyan-white-maroon or cyanmaroon
- grayscale or gray
- lipophilicity (default for the mlp command, along with range -20,20)
- ColorBrewer palettes - a default number of colors will be used if the number is omitted from the name. Examples:palette pastel2-4Users should cite: www.ColorBrewer.org, color specifications and designs by Cynthia A. Brewer, Pennsylvania State University.
- color1:color2:color3... a series of color specifications separated by colons, collectively enclosed in quotation marks if it contains any spaces (example: palette cornflowerblue:red:gold or palette "cornflower blue:red:gold"). The colors are placed evenly in ascending value order along the range, with the first and last colors at the extremes. Colors for intermediate values are interpolated.
- value1,color1:value2,color2:value3,color3... a series of value,color pairs separated by colons, collectively enclosed in quotation marks if it contains any spaces (example: palette "0,cornflower blue:1,gold:0.7,red"). For sequential coloring, an entire range (such as the residues in each chain or the chains in each model) is always mapped to fractional values 0.0-1.0. For numerical data, the values can be expressed directly on the scale of the data (range not used) or as fractional values 0.0-1.0 across a range of data specified with range. Values below the lowest given value will map to the same color as the lowest, and values above the highest will map to the same color as the highest. Colors are interpolated between specified value-color pairs; discrete coloring can be achieved by specifying the same color for the upper- and lower-bound values of a “bin.”
- colourlovers-id - the ID number, name, or name+author of a palette to be fetched from COLOURlovers.com. Examples:palette 92095The page of a specific palette at COLOURlovers.com shows its name, author, ID number (in the URL), and any licensing stipulations for its use. Palette names with spaces must be enclosed in quotation marks. Palette names are not necessarily unique, and the most-viewed palette of a specified name will be fetched unless by author is appended, as in the example above. Palette and author names must be capitalized as shown on the website. Palettes with “all rights reserved” cannot be fetched. In ChimeraX, the palette colors are used in left-to-right order, spaced equally along the range of values. Web-fetched palettes are cached locally as described for open.
palette "Giant Goldfish"
palette "Giant Goldfish by manekineko"
range  low,high | full
For numerical data only (not sequential coloring), what values should map to the extremes of the palette (default full, the minimum and maximum values for the items to be colored). Alternatively, low and high values separated by a comma only can be supplied. When multiple models are colored in a single command, the full range is determined separately for each model.
color /d & helix sky blue target c- color chain D helices sky blue, cartoons only (not atoms, etc.)
– or – color /d & helix sky blue cartoons
color /A,B:12,260-275 hot pink target a- color residues 12 and 260-275 in chains A and B, atoms/bonds only
– or – color /A,B:12,260-275 hot pink atoms
color pbonds yellow- color all pseudobonds yellow
color C bymodel targ a- restore original model coloring to all carbon atoms
color seq res- rainbow-color residues blue → red along each biopolymer chain
– or –
– or –
color #3 seq chain palette cyan- color the chains in model 3 from a medium cyan through white to dark maroon
– or –
rainbow #3 chain palette cyan
color seq polymers targ c palette cornflowerblue:red:gold- color the unique biopolymers in each atomic model, cartoons only, along the range cornflower blue → red → gold (chains that are the same biopolymer will be the same color)
– or –
rainbow polymers targ c palette cornflowerblue:red:gold
open 1qmv; rainbow protein chain palette paired-10- color the protein 10-mer in PDB entry 1qmv using the 10-color version of the “paired” ColorBrewer palette
The command color name assigns cname as the name of the specified color. It can be used to define a new color name or redefine an existing one. Color names must begin with an alphabetical letter and may contain only lowercase letters, numbers, hyphens, underscores, and spaces. If cname has embedded spaces, it must be enclosed in quotation marks.Examples:
color name tpurple 60,0,80,50
color name tgreen rgba(0%, 80%, 40%, 0.5)
The command color delete can be used to “forget” a specific user-defined color or all custom (user-defined) colors. A built-in color name cannot be deleted.
The command color list lists color names along with color swatches in the Log, with options:
The command “color show cname” reports in the Log the rgba (red, green, blue, opacity) definition of an existing color named cname. See also: palette list