Re: XForms: xforms colors

Steve Lamont (spl@szechuan.ucsd.edu)
Mon, 28 Dec 98 08:01:58 PST

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> I am having trouble with colors in xforms. I'm using pseudocolor and my
> own color map for viewing images in a X canvas (252 gray scale + 3 primary
> colors for overlay markings) with XPutImage.
> I want to tell xforms which colors to use, but I can only set a few of
> each objects colors, using fl_set_object_color and giving the index in my
> colormap. Buth How can I control the 3D frame and button effects colors ?

Basically, you can't -- at least not exactly.

You will have to do some form of color quantization. I have written a
color quantization library, some form of which my be included in the
next release of XForms. In the meantime, you can use it in its
"native" form. Check

ftp://ncmir.ucsd.edu/pub/quantize

A HTMLized man page is to be found at

ftp://ncmir.ucsd.edu/pub/quantize/libquantize.html

> I went throgh the forms.h file and tried to change the colors enum
> orther and numbers so that xforms would fecth the right gray scale values
> from my colormap. This also proved unsuccessful.
> How does xforms lookup a color, for istance FL_COL1 is 11, I chamged
> forms.h to have FL_COL1 = 161, expecting it to fetch the color from the
> colormap index 161, but it didn't. The must be some hidden table or
> process that I am missing, or some more basic thing that I am overlooking.

This won't work because the color indices are compiled into the
library. You can change the internal color map colors using the
fl_set_icm_color() function. Refer to the secton on Color in Chapter
3 of the manual for details on this and related functions.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/