<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSColor/getCyan(_:magenta:yellow:black:alpha:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSColor(im)getCyan:magenta:yellow:black:alpha:"
  },
  "title" : "getCyan(_:magenta:yellow:black:alpha:)"
}
-->

# getCyan(_:magenta:yellow:black:alpha:)

Returns the color object’s CMYK and opacity values.

```
func getCyan(_ cyan: UnsafeMutablePointer<CGFloat>?, magenta: UnsafeMutablePointer<CGFloat>?, yellow: UnsafeMutablePointer<CGFloat>?, black: UnsafeMutablePointer<CGFloat>?, alpha: UnsafeMutablePointer<CGFloat>?)
```

## Parameters

`cyan`

Upon return, contains the cyan component of the color object.

`magenta`

Upon return, contains the magenta component of the color object.

`yellow`

Upon return, contains the yellow component of the color object.

`black`

Upon return, contains the black component of the color object.

`alpha`

Upon return, contains opacity value of the color object.

## Discussion

If `NULL` is passed in as an argument, the method doesn’t set that value. This method works only with objects representing colors in the [`deviceCMYK`](/documentation/AppKit/NSColorSpaceName/deviceCMYK). Sending it to other objects raises an exception.

## See Also

[`blackComponent`](/documentation/AppKit/NSColor/blackComponent)

The black component value of the color.

[`cyanComponent`](/documentation/AppKit/NSColor/cyanComponent)

The cyan component value of the color.

[`yellowComponent`](/documentation/AppKit/NSColor/yellowComponent)

The yellow component value of the color.

[`magentaComponent`](/documentation/AppKit/NSColor/magentaComponent)

The magenta component value of the color.

[`alphaComponent`](/documentation/AppKit/NSColor/alphaComponent)

The alpha (opacity) component value 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)