7 Color in the Window Tool Kit

7.2 Using color in the Window Tool Kit

Most output functions in the Window Tool Kit take color arguments, usually called color or foreground. Some functions require both a foreground and background color, in which case the arguments to the function are called foreground and background. If you specify only one of these arguments, the Window Tool Kit uses the default value for the unspecified argument. The default foreground value is usually'BLACK, and the default background value is usually'WHITE.

More complicated uses of color can require complex transformations between bitmaps and direct manipulation of the color table. However, the following sections give directions for the most common uses of color.

The first step in using color is to invoke the Window Tool Kit on a display that supports both graphics and color. If you do not know whether your display supports graphics and color, you can use Lisp to find out.

Invoke the function windows-available-p. If your display supports graphics, this function returns three values: the width, height, and depth of the display. If the depth of the current display is larger than 1, the display also supports color operations. The function display-depth also returns the depth of the current display.

By default, only the colors'BLACK and'WHITE are registered. You must register any other colors that you want to use; the function setup-color-library registers colors for you.

7.2.1 - The shortest route to displaying color
7.2.2 - Registering colors
7.2.3 - Finding information about registered colors
7.2.4 - Using registered colors

The Window Tool Kit - 9 SEP 1996

Generated with Harlequin WebMaker