RGB, readcolmap, writecolmap – access display color map|
int readcolmap(Display *d, RGB *map)
int writecolmap(Display *d, RGB *map)
Colors are described by their red, green, and blue light intensities,
in an RGB datum:|
A color map is an array of RGBs, of length 2depth, giving the colors for pixels 0, 1, 2, etc. On displays with color mapped pixels (typically 8–bit displays), one retrieves RGB color information by treating the pixel data as an offset into the color map.
Readcolmap reads the color map for the given display into the provided map, which must have enough space to hold it. Writecolmap associates the given color map with the given display, if possible. (The hardware might not allow this.) Both return 0 on success, or –1 on error, setting errstr.
graphics(2), draw(3), color(6)|