Colormaps.

Harish Hiriyannaiah harish at csl.ncsu.edu
Tue Oct 3 04:54:37 AEST 1989


I am having trouble loading color maps in X11 r3 (also using HPWidgets).
I can set the Red and Blue LUTs with no problem for any or all of the 256 
colors, but Green has me stumped.  Here is the code that is used to load an
entire map (I have also tried permutations of XAllocColorCells for 
read/write cells and XAllocColor for read/only cells with no success)
LoadColorMap returns a valid XColor array and correct number of colors. 
Has anyone out there any suggestions ?

        user_color = LoadColorMap(mapfilename,&num_usercolors);
        if (num_usercolors > DisplayCells(disp,DefaultScreen(disp)))
           num_usercolors = DisplayCells(disp,DefaultScreen(disp));
        user_colormap = XCreateColormap(disp,root_window,default_visual,
                                         AllocAll);
        XStoreColors(disp,user_colormap,user_color,num_usercolors);
	XSetWindowColormap(disp,root_window,user_colormap);
        XInstallColormap(disp,user_colormap);

Comments:

disp = disp of Toplevel widget from XtInitialize.
root_window = root_window of Toplevel widget.
default_visual = default_visual of Toplevel widget.
user_color[i].flags = DoRed|DoGreen|DoBlue;

Environment: Ultrix 3.1, VaxStation 3100, HP Widgets. The server is a
             DECStation 3100.

harish pu. hi.				harish at ecebucolix.ncsu.edu
					harish at ecelet.ncsu.edu



More information about the Comp.unix.ultrix mailing list