COLOR (Color) keyword in printer files

Use this field-level keyword to specify the color for a field.

This keyword can be used only with printers that provide support for it, such as the 4224 and the Infoprint® Hi-Lite Color Printer, model 4005-HCI. If you do not specify COLOR or if the keyword is not valid for a printer device, black (the default value) is used.

The format of the keyword is:
COLOR(color-name | *RGB rvalue gvalue bvalue |
      *CMYK cvalue mvalue yvalue kvalue |
      *CIELAB lvalue c1value c2value |
      *HIGHLIGHT hvalue coverage)
You can specify color for a view by using one of five methods:

Color name model

For the color-name, you can specify one, and only one, of the following parameter values for COLOR:

Parameter Meaning
BLK Black
BLU Blue
BRN Brown
GRN Green
PNK Pink
RED Red
TRQ Turquoise
YLW Yellow

RGB color model

For the RGB color model, specify three RGB integer values in the following form:

COLOR (*RGB rvalue gvalue bvalue)

The rvalue represents a value for red; gvalue represents a value for green; and bvalue represents a value for blue. Specify each of the three integer values as a percentage from 0 to 100.

Note: An RGB specification of *RGB 0 0 0 is black. An RGB specification of *RGB 100 100 100 is white. Any other value is a color somewhere between black and white, depending on the output device.

CMYK color model

For the CMYK color model, specify four integer values in the following form:

COLOR (*CMYK cvalue mvalue yvalue kvalue)

The cvalue represents a value for cyan, mvalue represents a value for magenta, yvalue represents a value for yellow, and kvalue represents a value for black. Specify each of the four integer values as a percentage from 0 to 100.

CIELAB color model

For the CIELAB color model, specify three values in the following form:

COLOR (*CIELAB lvalue c1value c2value)

The lvalue specifies the luminance value. The valid range for the lvalue is 0.00 to 100.00. Use signed integers from -127 to 127 for the c1value and c2value to specify the chrominance differences.

Highlight color model

For the Highlight color model, specify two values in the following form:

COLOR (*HIGHLIGHT hvalue coverage)

Highlight colors are device-dependent. You can specify them for the IBM® InfoPrint Hi-Lite Color Printer, Model 4005-HCI. You can specify an integer within the range of 0 to 65535 for the hvalue.

The coverage value indicates the amount of the highlight color that is to be used. Specify the coverage value as a percentage from 0 to 100. If you specify less than 100 percent, the remaining coverage is achieved with the specified color.

Notes:
  1. An hvalue of 0 indicates that there is no default value defined. Therefore, the default color of the presentation device is used, and the remaining coverage is achieved with the default color.
  2. The following monochrome IBM IPDS™ printers support gray scaling when you specify highlight color:
    • Infoprint 60
    • Infoprint 62
    • Infoprint 2000
    • Infoprint 3000
    • Infoprint 4000
    These printers must be at ucode level 8.3 or later.

Use the COLOR keyword

If you use COLOR on the same record format with the BLKFOLD, CPI, or DFNCHR keyword, the file is not created.

COLOR is valid on IPDS and IPDS AFP(*YES) printers. If you specify DEVTYPE(*SCS) on the CRTPRTF command, a warning message results but the file is created successfully.

Valid data types for this keyword are A, S, and F.

When you specify COLOR more than once for a field, you must specify option indicators each time you specify COLOR. If more than one COLOR is in effect when printing the field, the first one in effect is used. You cannot specify the same color more than once on the same field. The following example shows the effects of specifying COLOR for a field.

Option indicators are valid for this keyword.

Example

The following example shows how to specify the COLOR keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A  99                              1  3'PRINT RED TEXT'
     A                                      COLOR(RED)
     A            FIELD1         3A    12 01TEXT('PINK IF 02, +
     A                                      YELLOW IF 07, +
     A                                      BLACK IF NEITHER')
     A  02                                  COLOR(PNK)
     A  07                                  COLOR(YLW)
     A            FIELD2        10A    20 01COLOR(*CIELAB 76.0 -25 65)
     A

In the example, if indicator 99 is ON, the constant field 'PRINT RED TEXT' prints in red. FIELD1 prints in pink, yellow, or black, depending on the indicators 02 and 07. FIELD2 specifies to print using the CIELAB color model. The luminance value is 76.0; the c1value is -25; and the c2value is 65.

Related concepts
BOX (Box) keyword in printer files
Related reference
LINE (Line) keyword in printer files