Turn
CONST x = 3: CONST y = x
into:
CONST x = 3
CONST y = x
And the glitch should go away, when it presents itself.
_RGBAhttp://qb64.org/wiki/RGBA (http://qb64.org/wiki/RGBA) so is the bug in CONST or in _RGBA ???
The _RGBA function returns the closest palette index (legacy SCREEN modes) OR the 32-bit LONG color value (32-bit screens).
OR the 32-bit LONG color value (32-bit screens).and to limit _RGBA to legacy screen mode? _RGBA32 --> 32mode & _RGBA-->legacy QB mode from 0 to 13
You’re using SINGLE type variables and falling outside their range of precision, losing information.
CONST White~&& = ...
Just my guess, without actually running the code.
.....
Either that, or else you need a _DELAY after the SCREEN call so you can switch screen modes to a 32-bit screen, before the RGBA value is set. It may be a race condition where you’re getting values before SCREEN has finished swapping screen modes.
Print the values and compare what the results are, to what you think they should be.
CONST are set in the precompile stage -- even before the translation of your code to C -- there's no way for any of them to know what SCREEN you're going to be using in your programand so I must remark to _RGBA then the will to work in 32bit mode
You need to set that last parameter to the screen mode which you want to use _RGB and _RGBA with, when using it inside a CONST.
The _RGB(A) functions doesn't define a new color, they just look for the color on your screen or its palette.
RULE:
define -> use _RGB(A)32
query -> use _RGB(A)
Hi. Rewrite 32 bit screen to 8 bit (,256) color screen without repairing CONSTs to _RGBA32, then it works correctly. _RGBA is for 8 bit screens (and for text mode). _RGBA32 is for 32 bit screens.
@Petr thanks you're right and I agree that the issue arises in 32 bit mode.
When using CONST to set values with _RGB and _RGBA, always use the extra parameter for the screen mode.
This seems unlogic to me, I mean obviously it works, but according to the Wiki for _RGB/_RGBA the last parameter is designated as image handle not as screen mode, so unless for the special case zero, which can be seen as mode as well as default handle, it shouldn't work that way.
However, I don't blame it is working that way for us. I've used the functions with image handles as well, so obviously both, handle and mode is valid for that last optional function argument. Probably just one more inconsistency in the Wiki.