<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSColor/init(deviceCyan:magenta:yellow:black:alpha:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSColor(cm)colorWithDeviceCyan:magenta:yellow:black:alpha:"
  },
  "title" : "init(deviceCyan:magenta:yellow:black:alpha:)"
}
-->

# init(deviceCyan:magenta:yellow:black:alpha:)

Creates a color object using the given opacity value and CMYK components.

```
init(deviceCyan cyan: CGFloat, magenta: CGFloat, yellow: CGFloat, black: CGFloat, alpha: CGFloat)
```

## Parameters

`cyan`

The cyan component of the color object.

`magenta`

The magenta component of the color object.

`yellow`

The yellow component of the color object.

`black`

The black component of the color object.

`alpha`

The opacity value of the color object.

## Return Value

The color object.

## Discussion

Values below 0.0 are interpreted as 0.0, and values above 1.0 are interpreted as 1.0.

## See Also

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

Returns the color object’s CMYK and opacity values.



---

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)