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

# takeColorFrom(_:)

Changes the currently selected color to the color of the specified object.

```
func takeColorFrom(_ sender: Any?)
```

## Parameters

`sender`

The object from which to take the new color.

## Discussion

This method attempts to access a property or accessor method named `color`. If the object doesn’t implement a `color` accessor, this method does nothing.

---

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)