Next: Window Operations for OS/2 Graphics, Previous: OS/2 Graphics Type, Up: OS/2 Graphics
These operations control the colors used when drawing on an OS/2 graphics device.
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
andset-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 callinggraphics-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:
- An integer between
0
and#xffffff
inclusive- This is the OS/2 internal RGB value.
- By name
- A limited number of names are understood by the system. Names are strings, e.g.
"red"
,"blue"
,"black"
. More names can be registered with thedefine-color
operation.- RGB (Red-Green-Blue) triples
- A triple is a list of three integers between
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.
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.