---
title: "module::setAlpha"
framework: Compute Graph
role: symbol
role_heading: Function
platforms: [iOS 27.0+, iPadOS 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: computegraph/module/setalpha
---

# module::setAlpha

Sets the alpha (opacity) value of an element.

## Declaration

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

## Parameters

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

## Discussion

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