Colors are assigned to labels and to words within labels using the two following syntaxes:
word= label name; color= color name or label= label name; color= color name; |
The color used for any label is determined by the order of any defined entries that are part of the label.
If a label contains a compartment word that has one or more colors specified, 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, if any exact match exists for the label name, then the specified color is used.
If there is no exact match for the label name, the color associated with the first specified label= value for the classification of the label is used.
If the classification has no color assigned, the color assigned to the first label that contains the same classification is used.
Following rule 3 in a system with the color definitions shown in the following screen, the label TS A displays with a yellow background because yellow is the color assigned to the TS classification. With the same definitions, any label with the C classification displays with the color blue, unless the label also contains the word B, in which case it displays with the color orange. However, any label with the U classification always displays with the color green (because B is defined elsewhere in the encodings as having a minclass of C, so it never appears in the same label with the classification U).
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; |
Following rule 4 in a system with the color definitions shown in the following example, TS A displays with the khaki background color because the TS classification did not have a color assigned, and TS SA is the only label that includes the TS classification and that has a color (khaki) assigned.
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 either refer to the rgb.txt file for color names to use for your site's labels or 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 of which indicates the amount of red, green, and blue present 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.
The number of colors available on the screen depends on the amount of memory available for specifying colors and number of color planes, on how many other window clients are using color cells, and whether private color maps are being used by other applications.
To minimize conflicts you should use color names or hexadecimal color values that you know have been specified for other applications that display without color flashing.
The default color values defined in Trusted Solaris label_encodings COLOR NAMES section have been chosen with these caveats in mind (see the following table).
Default COLOR NAMES Assigned to Label Components |
|
---|---|
label= Admin_Low; |
color= #bdbdbd; |
label= u; |
color= green; |
label= c; |
color= blue; |
label= s; |
color= yellow; |
label= ts; |
color= red; |
word= sb; |
color= cyan; |
word= cc; |
color= magenta; |
label= Admin_High; |
color= #636363; |
See "To Assign a Color to a Label or Word".
The following table may be used for planning color names.
Table 4-1 Color Names Planner
Label or Name (label= or name=) |
Color |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|