Go to the previous, next section.
These operations control the colors used when drawing on an OS/2 graphics device.
operation+: os2-graphics-device color?
This operation returns #t
if the display supports color.
operation+: os2-graphics-device set-background-color color-name
operation+: os2-graphics-device set-foreground-color color-name
These operations change the colors associated with a window.
Color-name must be one of the valid color specification forms
listed below. set-background-color
and
set-foreground-color
change the colors to be used when drawing,
but have no effect on anything drawn prior to their invocation. Because
changing the background color affects the entire window, we recommend
calling graphics-clear
on the window's device afterwards.
The foreground color affects the drawing of text, points, and lines. Colors are specified in one of these ways:
0
and #xffffff
inclusive
"red"
, "blue"
, "black"
. More names
can be registered with the define-color
operation.
0
and #xff
inclusive which specify the intensity of the red, green and blue
components of the color. Thus (0 0 0)
is black, (0 0 128)
is dark blue and (255 255 255)
is white.
If the color is not available in the graphics device then the nearest available color is used instead.
operation+: os2-graphics-device define-color name spec
Define the string name to be the color specified by spec. Spec may be any acceptable color specification. Note that the color names defined this way are available to any OS/2 graphics device, and the names do not have to be defined for each device.
Color names defined by this interface may also be used when setting the colors of the Scheme console window, or the colors of Edwin editor windows.
operation+: os2-graphics-device find-color name
Looks up a color previously defined by define-color
. This
returns the color in its most efficient form for operations
set-foreground-color
or set-background-color
.
Go to the previous, next section.