Difference between revisions of "ALPHA"

From QB64 Wiki
Jump to navigation Jump to search
imported>Odin
imported>Odin
Line 1: Line 1:
 +
{{DISPLAYTITLE:_ALPHA}}
 
The '''_ALPHA''' function returns the alpha channel transparency level of a color value used on a screen page or image.
 
The '''_ALPHA''' function returns the alpha channel transparency level of a color value used on a screen page or image.
  

Revision as of 01:38, 18 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