Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
17.  Administering Application Resources, Fonts, and Colors Administering Fonts User's Font Group Filesystem Storage  Previous   Contents   Next 
   
 

System Administrator Font Group Creation

So that other users can access the font groups on a workstation, the system administrator can copy font groups to the /etc/dt/sdtfonts/locale directory or to the /usr/openwin/lib/X11/stdfonts/locale directory. Session Manager first looks in HomeDirectory/.dt/stdfonts/host/locale, next in /etc/dt/sdtfonts/locale, and last in /usr/openwin/lib/X11/stdfonts/locale.

Administering Colors

This section describes:

  • How Style Manager sets display colors.

  • Resources used by Style Manager to control desktop color usage.

Color Palettes

A palette consists a group of color sets. The color sets for the current palette are shown in the Style Manager Color dialog box

A file exists for each palette. The paletteDirectories resource specifies the directories containing palette files. By default, this resource contains:

  • Built-in palettes: /usr/dt/palettes

  • System-wide palettes: /etc/dt/palettes

  • Personal palettes: HomeDirectory/.dt/palettes

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

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

1

Active window frame color

2

Inactive window frame color

3

Unused (by default)

4

Text entry areas

5

Application's main background areas

6

Application's menu bar, menus, and dialog boxes

7

Unused by default

8

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

1

Active window frame color

2

Inactive window frame color

3

Application and Front Panel background color

4

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

1

Active window frame, workspace selection buttons

2

All other display elements

Controlling Color with Style Manager

You can dynamically change color for desktop applications and other cooperating applications through Style Manager. The foreground and background colors set by Style Manager are available to non-cooperating applications.

For a client to respond to Style Manager color changes, the client must be using the desktop Motif library. Clients written with other toolkits cannot change color dynamically in response to Style Manager changes. Color changes for these clients do not take effect until the client is restarted.

There must be no other specific color resources applied for the client. This includes user-specified resources, application defaults, and resources built into the application.

Clients can specify primaryColorSetId and secondaryColorSetId resources to use certain colors within a desktop palette.

 
 
 
  Previous   Contents   Next