readcolmap man page on Plan9

Man page or keyword search:  
man Server   549 pages
apropos Keyword Search (all sections)
Output format
Plan9 logo
[printable version]


       RGB, readcolmap, writecolmap - access display color map

       #include <u.h>
       #include <libc.h>
       #include <draw.h>

       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:

	      struct RGB {
		    ulong red;
		    ulong green;
		    ulong blue;
	      } RGB;

       Black is represented by zero in all three positions and white  has  the
       maximum unsigned long value in all three positions.

       A  color	 map is an array of RGBs, of length 2^depth, giving the colors
       for pixels 0, 1, 2, etc.	 On displays with color mapped	pixels	(typi‐
       cally  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, set‐
       ting errstr.

       Changing the hardware color map does not change the color map  used  by
       the  draw(2)  operator  to  convert  between  mapped  and true color or
       greyscale images, which is described in color(6).


       graphics(2), draw(3), color(6)

                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net