Difference between revisions of "ALPHA"

From QB64 Wiki
Jump to navigation Jump to search
imported>Odin
imported>Odin
Line 21: Line 21:
 
<pre>Color: 36
 
<pre>Color: 36
 
Alpha: 255</pre>
 
Alpha: 255</pre>
 +
 +
== See also ==
 +
* [[_ALPHA32]]
 +
* [[_RED]], [[_RED32]]
 +
* [[_GREEN]], [[_GREEN32]]
 +
* [[_BLUE]], [[_BLUE32]]

Revision as of 02:24, 25 July 2017

The _ALPHA function returns the alpha channel transparency level of a color value used on a screen page or image.

Syntax

result& = _ALPHA(color~&[, imageHandle&])

Example

<source lang="qbasic"> SCREEN 13

clr~& = _RGBA(255, 0, 255, 192) 'returns closest palette color attribute PRINT "Color:"; clr~&

COLOR clr~& PRINT "Alpha:"; _ALPHA(clr~&)

END </source>

Output:

Color: 36
Alpha: 255

See also