creating your own colormap i e lookup table in x r hello below i have the copy of some source i am using to setup a user specified color map for x r v i am attempting to create user defined colors in terms of rgb color ranges the calls to xalloccolor prove ineffective variables are defined are as follows int i j k lut index color type min image max image color type image pixel value range last image start end jump lut unsigned long pixel double red green blue data structure used by color operations typedef struct unsigned long pixel unsigned short red green blue char flags do red do green do blue char pad xcolor xcolor rgbcolor hardwarecolor with color type defined as double red double green double blue what i need to know is how to set is it possible the values in hardwarecolor to work within the call to xalloccolor start red int min image red end red int max image red jump red int end red start red start green int min image green end green int max image green jump green int end green start green start blue int min image blue end blue int max image blue jump blue int end blue start blue lut index for i i i for j j j for k k k if i jump red lut lut index red start red else lut lut index red jump red i if j jump green lut lut index green start green else lut lut index green jump green j if k jump blue lut lut index blue start blue else lut lut index blue jump blue k hardwarecolor red short lut lut index red hardwarecolor green short lut lut index green hardwarecolor blue short lut lut index blue hardwarecolor pixel lut index printf hw i d d d d pixel d n lut index hardwarecolor red hardwarecolor green hardwarecolor blue hardwarecolor pixel status xalloccolor dpy colormap hardwarecolor printf hw i d d d d pixel d n lut index hardwarecolor red hardwarecolor green hardwarecolor blue hardwarecolor pixel if status xsetforeground dpy gc hardwarecolor pixel xfillrectangle dpy win gc maxcolumn maxrow xflush dpy sleep printf d f f f at d n lut index lut lut index re lut lut index green lut lut index blue hardwarecolor pixel lut index lut index thanks in advance to anyone who can help me with this problem sincerely john f duggan john f duggan alias genghis khan engineering computer services internet duggan ecs umass edu univ of massachusetts amherst ma bitnet duggan umaecs
