#

## color

Specify color to edit, or print intensities of the currently edited color

### Usage:

> color [number|next|last|get|rgb]

> > where number is the number of a color in the colormap list. Historically, this number was given in octal. This has been changed to the variable format of C syntax, in which numbers are treated as decimal unless beginning with "0" (zero), in which case they are treated as octal, or "0x" (zero-x), in which case they are treated as hexidecimal.

### Summary:

> The color command specifies the color number to edit in the colormap window. With no arguments, prints the color index and RGB values for the color being edited.

> In the Tcl-based version of magic, the "color picking" and "color copying" functions are no longer functional. For this reason, options color next and color last have been added to allow scrolling through the colors in the colormap. These commands are bound to the key macros "+" (plus) and "-" (minus), respectively.

> Options color get and color rgb return subsets of the information reported by color with no arguments. color get returns the color index of the color, and color rgb returns the individual red, green, and blue intensities of the color. In the Tcl-based version of magic, these values are returned as Tcl results.

> Note that color changes made in the color window do not immediately take effect on the layout. It is necessary to pass a refresh command to the layout window, or to type the Control-L macro in the layout window to update the colors.

### Implementation Notes:

> color is implemented as a built-in color window command in magic. It can only be invoked from a window created with the specialopen color command.

Return to command index

Last updated: October, 2004