In the LOCAL DEFINITIONS section, the COLOR NAMES keyword is followed by zero or more color assignments. If no color is defined for a classification in the COLOR NAMES section of the label_encodings file, the color black is used. The default color values are shown in the following excerpt.
COLOR NAMES: label= Admin_Low; color= #bdbdbd; label= PUB; color= blue violet; label= SBX PLAYGROUND; color= yellow; label= CNF; color= navy blue; label= CNF : INTERNAL USE ONLY; color= blue; label= CNF : NEED TO KNOW; color= #00bfff; label= CNF : RESTRICTED; color= #87ceff; label= Admin_High; color= #636363;
Colors are assigned to labels and to words within labels with the following syntax:
label= label-name; color= color-name; word= label-name; color= color-name;
The value of color-name can be either a text color name or a hexadecimal color value. The color is associated with a word or a label. The color that is assigned to a label's component displays as a background color whenever a label includes the specified label components. The windows software computes a complementary color for the lettering.
For an introduction to color values, see Color Values. A full discussion of how to specify color is outside the scope of this guide. For more information, see the X11(5) man page in the /usr/openwin/share/man directory. For a fuller description, see “Color Specification” in the O`Reilly and Associates, Inc. XWindows Systems User's Guide (Vol. III), ISBN number 0-937175-29-3.
Color is assigned to a label's components according to the ordering rules that are described in the following section. For a desktop example of color use, see Figure 5–2. The PUBLIC, INTERNAL, and NTK_SALES workspace buttons are colored differently from each other and from standard workspace buttons.
The color that is used for any label is determined according to the following rules.
If a label contains a compartment word that has one or more colors specified, then the color value associated with the first word= value is used.
If a label contains none of the compartment words that are associated with colors, and an exact match exists for the label name, then the specified label color is used.
If there is no exact match for the label name, then the color that is associated with the first specified label= value for the classification of the label is used.
If the classification has no assigned color, then the color that is assigned to the first label that contains the same classification is used.
In this example, a system has the following color definitions:
label= u; color= green label= c; color= blue label= S; color= red; word= B; color= orange; label= TS; color= yellow; label= TS SA; color= khaki;
The rules result in the following color display:
The label TS A displays with a yellow background, because yellow is the color assigned to the TS classification. Rule 3.
Any label with the C classification displays with the color blue, unless the label also contains the word B. Rule 2.
A label with the C B classification displays with the color orange, because word B is orange. Rule 1.
Any label with the U classification always displays with the color green. In the encodings file, word B cannot appear with the classification U. Rule 2.
This example illustrates rule 4. The label TS displays the color khaki, because TS SA is the only label that includes the TS classification. TS SA is defined to display the color khaki.
label= u; color= green label= c; color= blue label= S; color= red; word= B; color= orange; label= TS SA; color= khaki;
The /usr/openwin/lib/rgb.txt database translates color names into red, green, blue values. You can refer to the rgb.txt file for color names to use for your site's labels. You can also use hexadecimal color values.
Briefly, here are a few high-level points about color values:
Color values specify the amount of red, green, and blue (RGB) that compose the color.
RGB values can be specified with three hexadecimal numbers from 0 to FF. Each hexadecimal number indicates the amount of red, green, or blue in the color.
For example, pure red is #FF0000, pure green is #00FF00, pure blue is #0000FF, pure white is #FFFFFF, and pure black is #000000. For more information, see the X11(5) man page in the /usr/openwin/share/man directory.
The number of colors that are available on the screen depends on several factors:
Amount of memory available for specifying colors
Number of color planes
How many other clients are using color cells
Whether private color maps are being used by other applications