7.2 Using color in the Window Tool Kit

7.2.4 Using registered colors

Most graphics operations accept registered colors as arguments. Again, you can specify a registered color in one of three ways:

A simple example of using a registered color might be to draw a colored square in a window.

> (setq window (make-window :width 100 :height 100 
                            :depth (display-depth)))
#<Window 100x100x8 at (0,0) F665FB>

> (draw-rectangle window 10 10 :width 30 :height 20 :foreground "MAGENTA") NIL

If you have registered the primary colors, you should be able to see a magenta rectangle in the window.

You can explore more complex ways of using registered colors by looking at the code in Section 7.4 on page 77.

The Window Tool Kit - 9 SEP 1996

Generated with Harlequin WebMaker