CBL_SCR_ALLOCATE_COLOR

Finds an entry in the colormap for each of one or more given RGB values.

Syntax:
call "CBL_SCR_ALLOCATE_COLOR" using     table-count
                                        RGB-values
                                        color-attribute
                                        non-exact-match
                              returning status-code
Parameters:
Using call prototype (see Library Routines - Key) Picture (32-bit systems)
table-count cblt-x2-compx pic x(2) comp-x.
RGB-values Group predefined as cblt-generic-attr-rgb-values containing: Group, occurs n times, containing:
  cblte-garv-red-value   cblt-x2-compx   pic x(2) comp-x.
  cblte-garv-green-value   cblt-x2-compx   pic x(2) comp-x.
  cblte-garv-blue-value   cblt-x2-compx   pic x(2) comp-x.
  cblte-garv-filler   cblt-x1 occurs 2   pic x(2).
color-attribute cblt-x4-compx occurs n times. pic x(4) comp-x occurs n times.
non-exact-match cblt-x4-compx occurs n times. pic x comp-x occurs n times.
status-code See Library Routines - Key.
On Entry:
table-count The number of colors requested.
The table of color(s) to search for or add to the colormap.
On Exit:
color-attribute The table of indexes to the colormap corresponding to the colors requested. This can be an existing colormap entry, or an unallocated read-write colormap entry set to the requested color.
non-exact-match The table of flags indicating whether or not the corresponding occurrence of color-attribute represents an exact match. Zero if the match was exact, otherwise nonzero.
table-count The number of colors successfully allocated. This is normally the number requested but is less if the call was not entirely successful.
RGB-values The table of RGB values actually used during the search, truncated to suit the environment.
cblte-garv-filler Unused.
Comments:

The RGB value can either be specified as a literal or be obtained using a call to the CBL_SCR_NAME_TO_RGB routine. The algorithm for determining the nearest match is environment-defined.

See Also: