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

# init(from:)

Creates a color object from color data currently on the pasteboard.

```
init?(from pasteBoard: NSPasteboard)
```

## Parameters

`pasteBoard`

The pasteboard from which to return the color.

## Return Value

The color currently on the pasteboard or `nil` if `pasteBoard` doesn’t contain color data. The returned color’s alpha component is set to 1.0 if [`ignoresAlpha`](/documentation/AppKit/NSColor/ignoresAlpha) returns <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)