Thanks. I actually thought I was using _RGBA32, that's what I use everywhere else in my code.
But can you explain the totally inconsistent behaviour I posted?
I am in 32bit graphical mode and I am getting 3 different values for the same _RGBA() statement, including -1 which is not a valid colour number in any text or graphical mode.
When you use _RGBA to set a CONST you are actually pre-calculating the color value at compile time (CONST values are always stored as constants). Because of that, you get wrong values.
One last note: _RGB32(255, 255, 255) is &HFFFFFFFF, which translates to -1 if you don't use an _UNSIGNED LONG instead of a signed LONG. It is therefore a valid color value in 32bit mode (you can even COLOR -1 if you want for white in 32bit mode)
Ah, no fixing needed:Code: QB64: [Select]
Specify one last parameter to store the values for 32bit mode. _RGB32 doesn't require that.
colorIndex~& = _RGBA(red&, green&, blue&, alpha&[, imageHandle&])
Hmmm... how does this one make sense when the help says it is taking an image handle, not "mode%|imageHandle&"?
The mode% syntax is exclusive for use with CONST. Indeed undocumented.
You must use _RGBA32 for this purpose, not _RGBA which works different. There is also a color library available by forum member Steve. If i remember right it was called ColorAllLibrary.
Ok - was to slow :(
The mode% syntax is exclusive for use with CONST. Undocumented indeed.