Difference between revisions of "ALPHA"

From QB64 Wiki
Jump to navigation Jump to search
imported>Odin
(Created page with "The '''_ALPHA''' function returns the alpha channel transparency level of a color value used on a screen page or image. == Syntax == result& = '''_ALPHA'''(color~&[, imageHan...")
imported>Odin
Line 18: Line 18:
  
 
''Output:''
 
''Output:''
<pre>Color 36
+
<pre>Color: 36
 
Alpha: 255</pre>
 
Alpha: 255</pre>

Revision as of 03:16, 17 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