<!--
{
  "availability" : [
    "Reality Composer Pro: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ComputeGraph",
  "identifier" : "/documentation/ComputeGraph/module/setAlpha",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Compute Graph"
    ],
    "preciseIdentifier" : "module::setAlpha"
  },
  "title" : "module::setAlpha"
}
-->

# module::setAlpha

Sets the alpha (opacity) value of an element.

```
void module::setAlpha(half alpha)
```

## Parameters

`alpha`

The alpha value, where 0.0 is fully transparent and 1.0 is fully opaque

## Discussion

Use this function to control the transparency of an element
without modifying its RGB color components.

> Visual: ![Graph](module__setAlpha)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)