Trusted Solaris Label Administration

Specifying Colors for Labels

In the LOCAL DEFINITIONS: section, the COLOR NAMES: keyword is followed by zero or more color assignments. The default color values are shown in the following figure.


Example 4-2 COLOR NAMES Section in the LOCAL DEFINITIONS Section of label_encodings File


COLOR NAMES:

	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;
*
* End of local site definitions

In the COLOR NAMES section, the Security Administrator role assigns colors to words and to labels, The color name can be either a text color name or a hexadecimal color value to be associated with a word or a label. How to specify color values is discussed in "Color Values". A full discussion of how to specify color is outside the scope of this manual. See the discussion under "Color Specification" in the O`Reilly and Associates, Inc. XWindows Systems User's Guide (Vol. III), ISBN number 0-937175-29-3 for more information, if desired.

The color assigned to a label's component displays as a background color whenever a label includes the specified label components, according to the ordering rules described below. See Figure 4-2 for an example of how the color is used. Although the example is not in color, the PUBLIC, INTERNAL, and NTK_SALES workspace buttons are colored differently than the standard workspace buttons.


Note -

The windows software computes a complementary color for the lettering.


Figure 4-2 Window Label with a Background Color from the COLOR NAMES Section

Graphic

Order of Color Specification

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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).

Example 1: Colors Assigned to Words and Labels

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;
Example 2: Colors Assigned to Words and Labels

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;

Color Values

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:

To minimize conflicts you should use color names, or use 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 screen).

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".

Planning Color Names

The following table may be used for planning color names.

Table 4-1 Color Names Planner

Label or Name (label= or name=) 

Color