<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSColor/alphaComponent",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSColor(py)alphaComponent"
  },
  "title" : "alphaComponent"
}
-->

# alphaComponent

The alpha (opacity) component value of the color.

```
var alphaComponent: CGFloat { get }
```

## Discussion

The value of this property is between `0.0` and `1.0`, where `0.0` represents fully transparent and `1.0` represents fully opaque. If the color has no alpha component, the value of this property is `1.0`.

## See Also

[`getRed(_:green:blue:alpha:)`](/documentation/AppKit/NSColor/getRed(_:green:blue:alpha:))

Returns the color object’s RGB component and opacity values in the respective arguments.

[`getHue(_:saturation:brightness:alpha:)`](/documentation/AppKit/NSColor/getHue(_:saturation:brightness:alpha:))

Returns the color object’s HSB component and opacity values in the respective arguments.

[`getCyan(_:magenta:yellow:black:alpha:)`](/documentation/AppKit/NSColor/getCyan(_:magenta:yellow:black:alpha:))

Returns the color object’s CMYK and opacity values.

[`getWhite(_:alpha:)`](/documentation/AppKit/NSColor/getWhite(_:alpha:))

Returns the grayscale and alpha values of the color.



---

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)