Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [XForms] FL_PACK Question

0 views
Skip to first unread message

SBP

unread,
Mar 20, 2016, 7:01:47 PM3/20/16
to xforms-de...@nongnu.org
Hi there

I use the FL_GETR,FL_GETG,FL_GETB macros to extract color components
from a FL_PACK type in a 64 bit OS and it works just fine. I use these
to store static color lookup tables by using FL_PACK(r,g,b) and the
aforementioned macros afterwards. However, when obtaining a color value
via XGetPixel I have to use the macros in the opposite order indeed,
FL_GETB for red component, etc.

I believe these macros are supposed to be used in a consistent manner
with FL_PACK, not for direct Xlib programming. I don't know why
changing from 32 to 64 bits would make a difference, maybe that's
something to do with X11 (or a change of endianness?). I'm no expert,
but I'd recommend using something more Xlib-specific for dealing with
colors in Xlib. XQueryColor seems to be the right way to get the
components, as it considers the Xlib colormap as well.

Cheers!

SBP

0 new messages