Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide

Color Sets

Each color set in the current palette is represented by a color button in the Style Manager Color dialog box. Each color is identified by a color set ID—a number from 1 to 8.

Figure 17–1 Color set ID values for HIGH_COLOR

Graphic

Each color set is composed of up to five colors. Each color button displays the background color of the color set. The five colors in each color set represent the following display component resources:

foreground—the foreground of an application window or window frame. It is always black or white. This is generally used for text within windows and titles.

background—the background of the application or the window frame.

topShadowColor—the color of the top and left bevels of application controls (such as push buttons) and window frames.

bottomShadowColor—the color of the bottom and right bevels of application controls and window frames.

selectColor—the color that indicates the active state of certain controls, such as active toggles and buttons.

The number of color sets used by each palette is determined by the colorUse resource, which the user can set using the Style Manager Number of Colors To Use dialog box.

Specifying Color Values

Style Manager uses RGB values when writing color information to its palette files. The syntax for RGB numbers is:

#RedGreenBlue

Red, Green, and Blue are hexadecimal numbers, each 1 to 4 digits long, that indicate the amount of that color used. There must be the same number of digits for each of the colors. Thus, valid color values consist of 3, 6, 9, or 12 hexadecimal digits.

For example, white can be specified in any of the following ways:

#fff
#ffffff
#fffffffff
#fffffffffffff

If you set a color resource directly, you can use either the color name or RGB value. The file /usr/lib/X11/rgb.txt lists all the named colors.

How Color Sets are Mapped to Resources

The desktop maps color sets to various display elements through resources and makes the assignments shown in Table 17–5.

Table 17–5 Mapped Color Sets to Resources

Resource 

Display element 

activeColorSetId

Active window frame color

inactiveColorSetId

Inactive window frame color

textColorSetId

Text entry areas

primaryColorSetId

Application's main background areas

secondaryColorSetId

Application's menu bar, menus, and dialog boxes 

These resources take a color set ID as their value. Coloring display elements with color set IDs allows the element to dynamically change to the new color scheme when a new palette is selected with Style Manager.

You can use these resources for individual applications. For example, the following line shows how you would visually group all dtterm windows by using color set 8 for their primary color.

dtterm*primaryColorSetId:   8

Default Color Set Assignments

The color set IDs used for display elements depend on the Number of Colors setting in Style Manager:

Table 17–6 shows the color set IDs for high color (8 color sets)—Style Manager setting More Colors for Desktop.

Table 17–6 High color

Color set ID 

Display element 

Active window frame color 

Inactive window frame color 

Unused (by default) 

Text entry areas 

Application's main background areas 

Application's menu bar, menus, and dialog boxes 

Unused by default 

Front Panel background 

Table 17–7 shows the color set IDs for medium color (4 color sets)—Style Manager setting More Colors for Applications.

Table 17–7 Medium color

Color set ID 

Display element 

Active window frame color 

Inactive window frame color 

Application and Front Panel background color 

Text entry areas 

Table 17–8 shows the color IDs for low color (2 color sets)—Style Manager setting Most Colors for Applications.

Table 17–8 Low color

Color set ID 

Display element 

Active window frame, workspace selection buttons 

All other display elements