[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] FL_PACK Question

From: SBP
Subject: Re: [XForms] FL_PACK Question
Date: Sun, 20 Mar 2016 17:01:30 -0600

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]