WPALETTE-SET-USER-COLOR (op-code 7)

This operation allows you to assign selected system colors to COBOL color numbers. It uses two fields in the WPALETTE-DATA group item.

WPAL-COLOR-ID contains the number of the COBOL color you want to change. Values range from 1 (low-intensity black) to 16 (high-intensity white).
WPAL-USER-COLOR-ID    contains the number of the system color to use. You can use either WPUSER-COLOR-3D, which matches the system's color for the background of 3-D objects, or WPUSER-COLOR-BACKGROUND, which matches the system's color for window backgrounds. These values are defined in palette.def.

The following example redefines the COBOL color number 8 (which is gray in the default palette) to be the same as the system's 3-D color:

    MOVE 8 TO WPAL-COLOR-ID
    MOVE WPUSER-COLOR-3D TO WPAL-USER-COLOR-ID
    CALL "W$PALETTE" USING
       WPALETTE-SET-USER-COLOR, WPALETTE-DATA

Errors are handled in the same manner as the WPALETTE-SET-COLOR function. Note that under some systems, such as Microsoft Windows, the system colors can change dynamically at runtime. If this occurs, the runtime will automatically remap the colors in the palette as needed to match the new system colors.

For additional color configuration options, see the USER-GRAY, USER-WHITE, and USER-COLORS options of the DISPLAY FLOATING WINDOW verb.