colormap question hi experts i m kind of new to x the following question is strange to me i am trying to modify the contents of the colormap but failed without reason to me i am using the following piece of code toplevel xtinitialize argv testcolor null argc argv dpy xtdisplay toplevel scr defaultscreen dpy def colormap defaultcolormap dpy scr if xalloccolorcells dpy def colormap true null cells color pixel cells color red color green color blue color flags dored dogreen doblue xstorecolor dpy def colormap color printf n try to allocate the color d as d d d color pixel color red color green color blue xquerycolor dpy def colormap color printf n after allocate the color d is d d d color pixel color red color green color blue else printf n error couldn t allocate color cells running output try to allocate the color as after allocate the color is after xstorecolor xquerycolor just returned the original value no failure error displayed but the contents of colormap are obvious unchanged i also tried to draw a line using the colors but it turned out to be the unmodified colors so what is my problem how to modify the contents of the colormap any help information will be appreciated please send mail to yang cs umass edu william email yang cs umass edu by the way the following is the environment i am using output of xdpyinfo it shows the default visual is pseudocolor version number vendor string decwindows digitalequipmentcorporation uws vendor release number maximum request size longwords bytes motion buffer size bitmap unit bit order padding lsbfirst image byte order lsbfirst number of supported pixmap formats supported pixmap formats depth bits per pixel scanline pad depth bits per pixel scanline pad keycode range minimum maximum number of extensions adobe dps extension dpsextension shape mit shm multi buffering xinputextension mit sundry nonstandard dec xtrap default screen number number of screens screen dimensions x pixels x millimeters resolution x dots per inch depths root window id x depth of root window planes number of colormaps minimum maximum default colormap x default number of colormap cells preallocated pixels black white options backing store yes save unders yes current input event mask xd d keypressmask buttonpressmask buttonreleasemask enterwindowmask substructureredirectmask propertychangemask colormapchangemask number of visuals default visual id x visual visual id x class pseudocolor depth planes size of colormap entries red green blue masks x x x significant bits in color specification bits visual visual id x class grayscale depth planes size of colormap entries red green blue masks x x x significant bits in color specification bits visual visual id x class staticgray depth planes size of colormap entries red green blue masks x x x significant bits in color specification bits visual visual id x class staticcolor depth planes size of colormap entries red green blue masks x x xc significant bits in color specification bits visual visual id x class truecolor depth planes size of colormap entries red green blue masks x x xc significant bits in color specification bits number of mono multibuffer types visual id max buffers depth x visual id max buffers depth x visual id max buffers depth x visual id max buffers depth x visual id max buffers depth x number of stereo multibuffer types
