Colors - Ultramarine.com Colors

Colors in MOSES are treated by first defining a set of colors which may be used and then assigning individual colors to a "color scheme". Color schemes are then used by assigning them to styles (which are discussed below), or by special names which are used to draw the user interface window.

Both colors and color schemes are defined with the command:


     &COLOR NAME -OPTIONS

To define a color, NAME should be omitted and the option:



     -COLOR_ADD, C_NAME, RVAL, GVAL, BVAL

should be used. Here, C_NAME is the name of the color to be defined and RVAL, GVAL, and BVAL are the intensities of red, green, and blue respectively. These values are 0 for none of this color and 255 for the maximum of this color. Thus, to define yellow, one should use

     &COLOR -COLOR_ADD YELLOW 255 255 0

By default, there are over 400 colors already defined (more than the colors in the X11 file rgb.txt). To see what colors are predefined, one can use the command:



     &COLOR -NAMES

The &COLOR command is also used to define the color maps used for pictures; i.e. the map which maps ratios and intensities to colors. This is accomplished with the options:


     -S_MAP, C_NAME(1), C_NAME(2), .... C_NAME(n)

and


     -R_MAP, C_NAME(1), C_NAME(2), .... C_NAME(n)

Here, -S_MAP defines the color map used for stress coloring and -R_MAP defines the map for ratio coloring. C_NAME(i) are the names of colors and there can be from two to 128 names. If d = 1. / (N - 1) where N is the number of names specified, then C_NAME1 is used for ratios between 0 and d, C_NAME(2) between d and 2d, ... C_NAME(n-1) between (n-2)d and 1, and C_NAME(n) for ratios greater than 1.

The final thing accomplished with the &COLOR command is the definition of color schemes. A color scheme is two sets of colors, one "normal" the other "special". Each of these has: a background color, a foreground color, box edge colors, selected colors, and line colors. The normal colors are those used except when a special effect is desired: Reverse video for something selected in a menu, or a line that is below the water. The option:



     -USE, C_NAME

causes MOSES to load up the color scheme C_NAME and then what follows will only change what is in C_NAME. Thus, if one uses this option he need only specify those things that he wishes to be different from C_NAME. Likewise, if one issues:

     &COLOR NAME .....

and the color scheme NAME exists, then he is actually editing NAME. There are several color schemes predefined in MOSES: DEFAULT, BASIC_FRAME, BASIC, MENU, WIDG_FRAME, WIDGET, and H_COPY. The first of these is the basis for most things. BASIC, BASIC_FRAME and MENU are used for the components of the MOSES User Interface Window and WIDG_FRAME and WIDGET are used for things that "pop up" in this window. H_COPY is used for things which are written to hardcopy devices. In general, the only difference between these is the color of the background.

All of these colors themselves are defined with the options:


     -N_BACKGROUND, C_NAME

     -S_BACKGROUND, C_NAME

     -N_FORGROUND, C_NAME

     -S_FORGROUND, C_NAME

     -N_BEDGE, C_NAME(1), C_NAME(2)

     -S_BEDGE, C_NAME(1), C_NAME(2)

     -N_SELECT, C_NAME(1), C_NAME(2)

     -S_SELECT, C_NAME(1), C_NAME(2)

     -N_LINES, C_NAME(1), C_NAME(2), .......... C_NAME(6)

     -S_LINES, C_NAME(1), C_NAME(2), .......... C_NAME(6)

The options -N_BACKGROUND and -S_BACKGROUND define the background colors. Here (and what follows), the prefix -N_ defines "normal" colors and -S_ defines "special" ones. The options -N_FORGROUND and -S_FORGROUND define the foreground colors. The options -N_BEDGE and -S_BEDGE each define two colors. The first color is for a sunken box and the last for a raised box. The options -N_SELECT and -S_SELECT also define two colors, the first for quantities selected and the second for those not selected. Finally, the options -N_LINES and -S_LINES define six colors for "logical lines 1 - 6". These are used in both graphs and pictures. For example when drawing a graph, the foreground color is used for the border and the axes and line color 1 is used for the first curve, line color 2 for the second curve, etc.