[PD] Extracting RGB components of iemgui's
Mathieu Bouchard
matju at artengine.ca
Mon Jul 4 19:43:30 CEST 2011
On Mon, 4 Jul 2011, Chris McCormick wrote:
> Thanks for the tip. I did have a look at [#to_iem] as well but all
> examples and documentation on this topic seems to be around converting
> to IEM numbers as you point out.
But note that opposite features will have similar code in them. For
example, >>10 in one formula is <<10 in the other so that it cancels the
first one.
You can also use [#to_iem] as a testing device to make sure that reverting
the conversion gets back to the original values of R,G,B.
> Ah, this is great. Thanks for this information! One last thing I am
> confused about is how I can tell the difference between the 18 bit iem
> format and the 24 bit format?
The 18-bit iem format is used in constructors (creators) such as the ones
you find in dynamic patching and pd files.
The 24-bit iem format is used in the method named 'color'.
> Also, what is the iemgui_modulo_color() function all about? I have
> implemented it for consistency but I don't understand why it is there.
it's a stupid function for doing :
stuff %= IEM_GUI_MAX_COLOR;
The % operator is not exactly the same as the modulo concept, but when the
input is never negative, it IS the exactly the same.
IEM_GUI_MAX_COLOR is for size of the built-in palette, that is, 30
colours.
_______________________________________________________________________
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
More information about the Pd-list
mailing list