PC_PRINTER_SET_COLOR

Sets the color on the printer.

Syntax:

call "PC_PRINTER_SET_COLOR"  using    printer-handle
                            by value  fore-or-back
                            by value  color-red
                            by value  color-green
                            by value  color-blue
                            returning status-code

Parameters:

  Using call prototype (see Key) Picture
printer-handle cblt-x4-comp5 pic x(4) comp-5.
fore-or-back cblt-x2-comp5 pic x(2) comp-5.
color-red cblt-x2-comp5 pic x(2) comp-5.
color-green cblt-x2-comp5 pic x(2) comp-5.
color-blue cblt-x2-comp5 pic x(2) comp-5.
status-code See Library Routines - Key

On Entry:

printer-handle
The handle of the printer, returned when the printer was opened.
fore-or-back
Whether to set the foreground or background color:
1 Foreground
2 Background
color-red
Value between 0 and 255; intensity of red
color-green
Value between 0 and 255; intensity of green
color-blue
Value between 0 and 255; intensity of blue

On Exit:

status-code No status codes are returned by this routine.

Comments:

You must open the printer before using this routine.

You specify the color you want by combinations of values showing the intensity of the three primary colors. For example, to get the colors in the following table, you set the RGB values as shown:

Color Red Green Blue
Red 255 0 0
Yellow 255 255 0
Green 0 255 0
Cyan 0 255 255
Blue 0 0 255
Magenta 255 0 255
White 255 255 255
Black 0 0 0

Some other, more unusual, colors are:

Color Red Green Blue
Dark orange 255 140 0
Navy blue 0 0 128
Violet 238 120 238
Beige 245 245 220

If your printer does not support color, it is up to the printer device driver to interpret these values. For example, some perform gray-shading; others choose either black or white for each color.