Specifying Colors When Starting X Applications

Once you've looked over the colors in the xcolormap, you're probably ready to experiment with X and colors. Notice that many colors are more than one word long. When you specify them on command lines, run them together into one long word. Suppose, for example, that you want to use the color "medium slate blue" when starting an application. Specify it on the command line as mediumslateblue.

For details about specifying colors in X applications, refer to the appropriate manual page. Usually you can use the command-line switches listed in the table below to specify color for a certain window feature.

Command Switches for Color

------------------------------------------ Switch Window Feature Affected

------------------------------------------ -bg background color -fg foreground (text) color -bd border color -ms mouse cursor color -cr text cursor color -hd color of clock hands (for xclock) ------------------------------------------

For example, here are some commands you might want to try that use the color switches:

If you know how to work with a .Xresources file, you can also define default colors. For instance, you may have lines in your .Xresources file which are similar to the following:

xterm*background: DarkGreen

xterm*foreground: LightGray

emacs*foreground: DarkSlateGrey

emacs*cursorColor: BlueViolet

emacs*background: Thistle


Back to XWindows Help page