The Color Editor icon

Color Editor

The Color Editor allows colors to be created interactively. There are several ways to start the Color Editor, a tool in the Utilities category.

Clicking a color well opens the Color Editor (if it is not already open) and activates the well so that it reflects any color changes within the Color Editor. The border of the color well turns white to signify activation. The color defined in the Color Editor can be:

A color may be defined in the RGB, HLS, HSV, CMYK, or Gray (grayscale) Color space, and may include transparency (opacity < 1). In the RGB color space, for example, there are sliders for the red, green, and blue components, each ranging from 0 to 1. If the small box marked Opacity is clicked, a slider for the opacity value also appears. The range of color in the bar under each slider is adjusted to show what color would result from moving that slider to a particular position in the bar while leaving the other sliders in place. The resulting defined color is shown in the top part of the Color Editor and applied to the items described by the receiving color well (active color well or drag/drop target color well).

The Color name field shows a Tk color code consisting of "#" and 12 digits, 4 each for the red, green and blue (RGB) components of a color. Each component is expressed as a hexadecimal number (allowable characters 0123456789abcdef) ranging from 0000 (0 in the decimal system) to ffff (65,535 in the decimal system). Tk color codes can have different numbers of digits, but always a multiple of 3: if 3 digits total, then there is 1 digit per color component with f meaning saturation; if 6 total, there are 2 digits per component with ff meaning saturation (examples); and so on. If a 3-, 6-, or 9-digit code is entered in the Color name field, it will be expanded to 12 digits. Rounding effects may be evident when a shorter, less precise code is expanded. The Tk code reflects the RGB definition of the color shown at the top of the Color Editor, regardless of the Color space setting. Tk color codes do not include transparency information.

The Color Editor can be set to one of the built-in colors by typing the name into the Color name field and hitting return. The field will then revert to the corresponding Tk code.

Clicking the No Color button deletes the color assignments of the items described by the active color well. The ultimate result depends on the situation, because visible color is determined by a hierarchy. Assigning "no color" at an overriding level reveals the colors at the next level in the hierarchy. For example, individual atom and bond colors overrule color assigned at the model level; if "no color" is assigned to a set of atoms, they will assume their model-level colors.

Colors can be saved in the palette, the bar of rectangles near the the bottom of the Color Editor. The currently defined color can be dragged from the top bar to a palette slot; definitions of colors in the palette are saved in the preferences file. Clicking a color in the palette makes it the currently defined color.

The Help button brings up this manual page in a browser window. Close dismisses the Color Editor.


UCSF Computer Graphics Laboratory / March 2009