home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
x
/
xlibpr3.zip
/
basicwin
/
color
/
fprgb.frag
< prev
next >
Wrap
Text File
|
1989-11-25
|
797b
|
23 lines
XStandardColormap \f(CWbest_map_info\fP;
float red, green, blue;
unsigned long pixelvalue;
int status;
.XX "XGetStandardColormap, example using"
status = XGetStandardColormap(display, RootWindow(display,
screen), &best_map_info, XA_RGB_BEST_MAP);
if (!status)
{
printf("%s: specified standard colormap not available", argv[0]);
exit(-1);
}
pixelvalue = \f(CWbest_map_info\fP.base_pixel +
((unsigned long)(0.5 + (red * \f(CWbest_map_info\fP.red_max)) *
\f(CWbest_map_info\fP.red_mult) +
((unsigned long)(0.5 + (green * \f(CWbest_map_info\fP.green_max)) *
\f(CWbest_map_info\fP.green_mult) +
((unsigned long)(0.5 + (blue * \f(CWbest_map_info\fP.blue_max)) *
\f(CWbest_map_info\fP.blue_mult);