Oracle Solaris Trusted Extensions Label Administration

Order of Color Specification

The color that is used for any label is determined according to the following rules.

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

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

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

  4. If the classification has no assigned color, then the color that is assigned to the first label that contains the same classification is used.


Example 5–1 Colors Assigned According to Ordering Rules

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:



Example 5–2 Color Assigned to a Label With No Assigned Color

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;

Color Values

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:

For a sample color name planner, see Table 6–8. To assign colors, see How to Assign a Color to a Label or Word.