C Language and Libraries Help (clang.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Remapping Palette Functions
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
─────Run-Time Library───────────────────────────────────────────────────────
The _remapallpalette function remaps the entire color palette
simultaneously to the colors given in the <colors> array. The
<colors> array is an array of long integers where the size of the
array varies from 16 to 64 to 256, depending on the video mode.
The number of colors mapped depends on the number of colors
supported by the current video mode. The _remapallpalette function
works in all video modes (except _ORESCOLOR mode), but only with
EGA, MCGA, VGA, or SVGA hardware.
The first array element specifies the new color value to be
associated with color index 0 (the background color in graphics
modes). After the call to _remapallpalette, calls to _setcolor
will index into the new array of colors. The mapping done by
_remapallpalette affects the current display immediately.
The <colors> array can be larger than the number of colors
supported by the current video mode, but only the first <n>
elements are used, where <n> is the number of colors supported by
the current video mode, as indicated by the <numcolors> element
of the _videoconfig structure.
See: _videoconfig
The default color assignments of the color indexes and an
explanation of specifying a color with a long value are provided
on a separate screen.
See: ◄Graphic Mode Colors►
The _remapallpalette and _remappalette functions do not affect the
presentation-graphics palettes, which are manipulated with the
_pg_getpalette, _pg_setpalette, and _pg_resetpalette functions.
Return Value
If successful, _remapallpalette returns a nonzero value (short).
In case of an error, _remapallpalette returns 0 (short).
If successful, _remappalette returns the color value previously
assigned to <index>, or -1 if the function is inoperative (not
EGA, VGA, SVGA, or MCGA), or if the color index is out of range.
Note that _remapallpalette returns a short value and _remappalette
returns a long value.
-♦-