Colordef can be used to define a new color named color_name or to change the definition of an existing color. While both color_name and existing_color_name can contain letters, digits, and underscores, only existing_color_name can contain spaces. The red, green, blue, and alpha arguments must be floating point numbers between zero and one, inclusive. The alpha value denotes transparency, where 0.0 means completely transparent (invisible) and 1.0 means completely opaque (the default).
Color Definitions | |||
---|---|---|---|
color name | red | green | blue |
red | 1.0 | 0.0 | 0.0 |
green | 0.0 | 1.0 | 0.0 |
blue | 0.0 | 0.0 | 1.0 |
cyan | 0.0 | 1.0 | 1.0 |
magenta | 1.0 | 0.0 | 1.0 |
yellow | 1.0 | 1.0 | 0.0 |
white | 1.0 | 1.0 | 1.0 |
black | 0.0 | 0.0 | 0.0 |
Examples:
colordef lilac 0.5 0.5 1.0- create a color named lilac
colordef activesite red- create a color named activesite which is actually red
Colorpanel and fromeditor are special color names that indicate the current Color Editor color. Colordef can be used to save the current Color Editor color to a name before the color is changed, for example:
colordef myblue colorpanel
See also: color, bondcolor, ribcolor, modelcolor, rangecolor, the Color Editor