<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaAccessibility",
  "identifier" : "/documentation/MediaAccessibility/MACaptionAppearanceGetWindowOpacity(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Media Accessibility"
    ],
    "preciseIdentifier" : "c:@F@MACaptionAppearanceGetWindowOpacity"
  },
  "title" : "MACaptionAppearanceGetWindowOpacity(_:_:)"
}
-->

# MACaptionAppearanceGetWindowOpacity(_:_:)

Returns the preference for the overlay’s opacity.

```
func MACaptionAppearanceGetWindowOpacity(_ domain: MACaptionAppearanceDomain, _ behavior: UnsafeMutablePointer<MACaptionAppearanceBehavior>?) -> CGFloat
```

## Parameters

`domain`

The domain to retrieve the preference value from. See [`MACaptionAppearanceDomain`](/documentation/MediaAccessibility/MACaptionAppearanceDomain). Pass [`MACaptionAppearanceDomain.user`](/documentation/MediaAccessibility/MACaptionAppearanceDomain/user) unless the system defaults are needed for comparison.

`behavior`

A pointer to memory. On return, this memory holds the caption appearance behavior for this preference setting. For possible values see [`MACaptionAppearanceBehavior`](/documentation/MediaAccessibility/MACaptionAppearanceBehavior). Pass `NULL` when you do not need the behavior setting.

## Return Value

The float value, ranging from `0.0` to `1.0`, representing the opacity of the color behind all other caption elements.

---

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)