RGBA()
Syntax
Color.q = RGBA(Red, Green, Blue, Alpha)Description
Returns the 32-bit color value corresponding to the Red, Green, Blue and Alpha values.
Parameters
Red, Green, Blue The value of the red, green and blue components for the color. Each value must be between 0 and 255. Alpha The alpha component of the color. The value must be between 0 and 255. A value of 0 means fully transparent and a value of 255 means fully opaque.
Return value
Returns the combined color value.
Remarks
To extract the red, green, blue or alpha values from a 32-bit color value, use the Red(), Green(), Blue() and Alpha() functions. These functions are useful to perform Drawing operations.
Result varies from 0 to 4 294 967 295 shades. It is therefore advisable to use a 'quad', (Result.q) and set unused bytes to zero. Indeed, on a 32-Bit operating system, Result is a Long integer (by default) with a range of use from - 2 147 483 648 to + 2 147 483 647, so comparing two colors is hazardous with a Long integer.
Example
Debug RGBA(0, 0, 0, 0) ; Completely transparent black Debug RGBA(255, 255, 255, 255) ; White totally opaque
Example: Color 24-bits to Color 32-bits
Alpha = 255 ; Use a Quad (see remarks) Color24.q = ColorRequester() Color32.q = RGBA(Red(Color24), Green(Color24), Blue(Color24), alpha) Color32 = Color32 & $FFFFFFFF ; Zeroing unused bytes ; It's also possible to replace the two lines above with: ; Color32 = Color24 | Alpha << 24 Debug "Red " + Red(Color32) Debug "Green " + Green(Color32) Debug "Blue " + Blue(Color32) Debug "Alpha " + Alpha(Color32)
See Also
Red(), Green(), Blue(), Alpha(), RGB()
Supported OS
All