ColorEditor

DESCRIPTION

A utility module to assist the user in selecting and editing colors. The color may be selected from a scrolling list of names, or it may be edited interactively. Reasonable efforts are made to set the scrolling list and interactive editor to the same color, since they both map to the same output. When a color is selected from the scrolling list, the interactive editor's current color is set to the color's red/green/blue value. However, if the color is changed interactively, no attempt is made to map it to a name in the list. The scrolling list is unselected so that there is no apparent conflict.

The color is output in a string parameter, in the format accepted by cxParamColorFloatGet. Names selected from the scrolling list are not changed, so that they are more descriptive. If the color is changed by the interactive editor, the "RGB:" format is used for precision.

By default, the interactive editor requires that the "Accept" button be pressed before the color is output. The user may put the editor into "Simultaneous" mode, so that each mouse movement generates an output. This mode is discouraged, because of the large number of module firings it may cause.

Note: this module is not available in all implementations of IRIS Explorer, in particular not in the Windows NT version.

INPUTS

WIDGETS

Port: Color Name
Type: Scroll List
The color names present in the X rgb database (see showrgb(1)). Selecting a name causes the interactive editor's current color to be set to the RGB value of this name in the database. Note that there are often several names with the same RGB values, due to spelling variations and white space removal.

Port: Color Editor
Type: Button
This invokes the interactive color editor. The editor window may be dismissed to save screen space. Pressing this button reveals the color editor. The editor's internal state is preserved.

Port: Color Window
Type: Drawing Area
The color selected is displayed behind the "Color Editor" button.

OUTPUTS

Port: Color
Type: Parameter
The selected color is output in the format described in cxParamColorFloatGet.

KNOWN PROBLEMS

There is no transparency value editing. This should be added to the interactive editor.

It might make sense to separate the name database and interactive editor into two modules. Internal logic is complicated by the fact that two interactors are trying to set the same value, and the editor value cannot always be mapped into a database value. This would make it possible to set the initial value from the database, then modify it with the editor without loosing the original database selecting. The database module could then quantize input colors to the "closest" database color, if desired.

SEE ALSO

cxParamColorFloatGet.
[Documentation Home]
© The Numerical Algorithms Group Ltd, Oxford UK. 2000