<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSColorPickingDefault/alphaControlAddedOrRemoved(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSColorPickingDefault(im)alphaControlAddedOrRemoved:"
  },
  "title" : "alphaControlAddedOrRemoved(_:)"
}
-->

# alphaControlAddedOrRemoved(_:)

Sent when the color panel’s opacity controls have been hidden or displayed.

```
@MainActor func alphaControlAddedOrRemoved(_ sender: Any?)
```

## Parameters

`sender`

The color panel sending the message.

## Discussion

This method is invoked automatically when the opacity slider of the `NSColorPanel` is added or removed; you never invoke this method directly.

If the color picker has its own opacity controls, it should hide or display them, depending on whether the sender’s [`showsAlpha`](/documentation/AppKit/NSColorPanel/showsAlpha) method returns <doc://com.apple.documentation/documentation/Swift/false> or <doc://com.apple.documentation/documentation/Swift/true>.

---

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)