Black is represented by zero in all three positions and
white has the maximum
unsignedlong
value in all three positions.
Some of the graphics functions, such as
point
(see
bitblt(2)),
take a
pixel value
argument, which is a single
unsignedlong.
For a given bitmap,
rgbpix
returns the pixel value with a color closest to
the color represented by the
rgb
argument.
There is a
colormap
associated with each Bitmap. A colormap is an array of
RGBs,
of length
giving the colors for pixels 0, 1, 2, etc.
Rdcolmap
reads the colormap for the given bitmap into the provided
map,
which must have enough space to hold it.
Wrcolmap
associates the given colormap with the given bitmap, if possible.
(The hardware might not allow this.)