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

# module::setColor

Sets the color of an element to the specified RGBA value.

```
void module::setColor(half4 color)
```

## Parameters

`color`

The new color as a 4-component vector (red, green, blue, alpha)

## Discussion

Use this function to change the visual appearance of an element
by assigning a new color with alpha channel.

> Visual: ![Graph](module__setColor)

---

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)