# llGetAlpha

*LSL function*

```lsl
float float llGetAlpha(integer face);
```

- `integer face`: Face number or ALL_SIDES.

- Returns: `float`
- Energy: 10

Otherwise the return is in the range \[0, 1\], with 0.0 being fully transparent and 1.0 being fully solid.

Returns a [float](https://wiki.secondlife.com/wiki/float) that is the [Blinn-Phong](https://wiki.secondlife.com/wiki/PBR_Materials#nomenclature-changes) alpha of **face**.

```lsl title="How to use" frame="terminal"
float result = llGetAlpha(0);
```

## Examples

<details open>
<summary>Example 1</summary>

```lsl
//Tells the owner the alpha on all sides
default
{
    state_entry()
    {
        integer i = 0;
        integer max = llGetNumberOfSides();
        while(i < max)
        {
            llSay(0,"Face "+(string)i+" alpha is " + (string)llGetAlpha(i));
            ++i;
        }
    }
}
```

</details>

## Helper functions

```lsl
float AveragePrimAlpha()
{//Since this is so simple you may just want to inline it instead of including the function.
    return (llGetAlpha(ALL_SIDES) / llGetNumberOfSides());
}
```

```lsl
//if face 0 is "transparent" then make the prim "visible"
if (llGetAlpha(0))  ;
else llSetAlpha(1.0, ALL_SIDES);
```

## See also

### Functions

- [llSetAlpha](/functions/llSetAlpha/) — Sets the prim's alpha
- [llGetColor](/functions/llGetColor/) — Gets the prim's color
- [llSetColor](/functions/llSetColor/) — Sets the prim's color
- [llSetLinkColor](/functions/llSetLinkColor/) — Sets link's color
- [llSetLinkAlpha](/functions/llSetLinkAlpha/) — Sets link's alpha
- [llGetNumberOfSides](/functions/llGetNumberOfSides/) — Gets the number of faces on the prim

---

*Source: [LlGetAlpha](https://wiki.secondlife.com/wiki/LlGetAlpha) on the Second Life Wiki. Content from the Second Life Wiki articles LlGetAlpha (revision 1215692, 2023-12-01), Template:Interval (revision 1171797, 2012-08-20), Template:Interval/Footnote (revision 861003, 2010-04-14), Template:LSL Function/face (revision 1175878, 2013-01-06) and Template:LSL Function/alpha (revision 1168816, 2012-06-11), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llGetAlpha/
