W$PALETTE
The W$PALETTE library routine provides a number of functions to manage RGB colors and COBOL attributes.
NOTE -   isCOBOL allows you to work with RGB colors. A maximum of 16 million concurrent colors can be displayed on the screen at the same time. However, some old languages display only 16 colors at a time. For compatibility reasons isCOBOL supports this library routine, that allows definition of a palette of usable colors. In any case it is important to pinpoint that the use of this routine is deprecated.
Syntax:
 CALL "W$PALETTE" USING opCode 
                        parameters
                 GIVING paletteResult
Parameters:
opCode
Function to be executed. Valid values, defined in ispalette.def, are:
 
Show a dialog window to choose a color.
Retrieve the RGB color associated to a COBOL attribute.
Retrieve the maximum number of colors that the system can render simultaneously.
Set the RGB color associated to a COBOL attribute.
Check if the host system supports the W$PALETTE library routine.
parameters
Parameters depend on the opcode.
Return code:
returnCode definition and meaning depend on the opcode.
Examples:
Example - Select a color from palette and change a numbered color with the selection
working-storage section.
copy "isgui.def"
78  78color   value 3.
77  result    pic 9(2).
 
procedure division.
...
change-color.
   initialize wpalette-data 
   call "w$palette" using wpalette-choose-color,
        wpalette-data,
        giving result 
   move 78color to wpal-color-id
   call "w$palette" using wpalette-set-color,
        wpalette-data,
        giving result.
   ...
Example - Select a color from palette and change a numbered color with the selection
working-storage section.
copy "isgui.def"
78  78color   value 3.
77  result    pic 9(2).
 
procedure division.
...
change-color.
   initialize wpalette-data 
   call "w$palette" using wpalette-choose-color,
        wpalette-data,
        giving result 
   move 78color to wpal-color-id
   call "w$palette" using wpalette-set-color,
        wpalette-data,
        giving result.
   ...