SET-COLOR

Function

Defines default colors.

Syntax

SET-COLOR
[PRINT-TEXT-FOREGROUND=({color_name_lit|_var|_col}|{rgb})]
[PRINT-TEXT-BACKGROUND=({color_name_lit|_var|_col}|{rgb})]
[PRINT-PAGE-BACKGROUND=({color_name_lit|_var|_col}|{rgb})]
[LINE-COLOR=({color_name_lit|_var|_col}|{rgb})]
[FILL-COLOR=({color_name_lit|_var|_col}|{rgb})]

Arguments

PRINT-TEXT-FOREGROUND

Color in which the text is printed.

PRINT-TEXT-BACKGROUND

Background color behind the text.

PRINT-PAGE-BACKGROUND

Page background color.

LINE-COLOR

Line color used in DRAW and PRINT BOX. If not specified, the default is BLACK.

FILL-COLOR

Fill color used in DRAW (TYPE=BOX) and PRINT BOX. If not specified, the default is NONE.

{color_name_lit|_var|_col}

A color_name is composed of the alphanumeric characters (A-Z, 0-9), the underscore (_) character, and the dash (-) character. It must start with an alpha (A-Z) character. It is case insensitive. The name 'none' is reserved and cannot be assigned a value. A name in the format (RGBredgreenblue) cannot be assigned a value. The name 'default' is reserved and may be assigned a value. 'Default' is used during execution when a referenced color is not defined in the runtime environment.

{rgb}

red_lit _var|_col, green_lit|_var|_col, blue_lit|_var|_col where each component is a value in the range of 000 to 255. In the BEGIN-SETUP section, only literal values are allowed.

The default colors implicitly installed with Production Reporting include:

black = (0,0,0)

white=(255,255,255)

gray=(128,128,128)

silver=(192,192,192)

red=(255,0,0)

green=(0,255,0)

blue=(0,0,255)

yellow=(255,255,0)

purple=(128,0,128)

olive=(128,128,0)

navy=(0,0,128)

aqua=(0,255,255)

lime=(0,128,0)

maroon=(128,0,0)

teal=(0,128,128)

fuchsia=(255,0,255)

Description

SET-COLOR is allowed wherever PRINT or DRAW is allowed. It is used to set certain attributes of PRINT and DRAW. If the specified color name is not defined, then the setting for the color name 'default' is used. Use the color name 'none' to turn off color for the specified attribute.

Examples

begin-setup
  declare-color-map
    light_blue = (193, 222, 229)
  end-declare
end-setup
begin-program
  alter-color-map name = 'light_blue' value = (193, 233, 230)
  print 'Yellow Submarine' ()
    foreground = ('yellow')
    background = ('light_blue')
  get-color print-text-foreground = ($print-foreground)  
  set-color print-text-foreground = ('purple')
  print 'Barney' (+1,1)
  set-color print-text-foreground = ($print-foreground)
end-program
begin-program
  get-color line-color=($line-color)
  set-color line-color=('purple')
  draw (5,5) type='horz-line' width=10
  set-color line-color=($line-color)
end-program
begin-program
  get-color fill-color=($fill-color)
  set-color fill-color=('light grey')
  draw (5,5) type='box' width=10 height=10
  set-color fill-color=($fill-color)
end-program

See Also

DECLARE-COLOR-MAP, ALTER-COLOR-MAP, and GET-COLOR