as you show me _RGB gives as result the legacy number of color in SCREEN legacy mode and RGB value in SCREEN 32. So it can adapt its result to the kind of SCREEN and so it MUST be used after SCREEN statement.
Thanks again
For CONST, _RGB works a little differently than we'd normally see.
Normally, _RGB has 4 parameters -- Red, Green, Blue, optional IMAGE_HANDLE. (Maybe not after the changes to allow RGBA values with the RGB command; I'm not 100% certain of the new syntax.)
Since CONST are defined pre-compile, we can't use program handles for them, so that 4th optional parameter is used to specify a SCREEN MODE.
For example:
CONST Red1
= _RGB(255, 0, 0, 0), Red2
= _RGB(255, 0, 0, 13), Red3
= _RGB(0, 0, 255, 32)
Red1 is _RGB(255,0,0) for a SCREEN 0 image.
Red2 is _RGB(255,0,0) for a SCREEN 13 image.
Red3 is _RGB(255,0,0) for a SCREEN _NEWIMAGE(x,y,32) image.
The fourth parameter lets us spell out which RGB value we need to work properly with our program.
(Whereas _RGB32 always just gives us the 32-bit values.)