<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCell/highlightColor(withFrame:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCell(im)highlightColorWithFrame:inView:"
  },
  "title" : "highlightColor(withFrame:in:)"
}
-->

# highlightColor(withFrame:in:)

Returns the color the receiver uses when drawing the selection highlight.

```
func highlightColor(withFrame cellFrame: NSRect, in controlView: NSView) -> NSColor?
```

## Parameters

`cellFrame`

The bounding rectangle of the receiver.

`controlView`

The control that manages the cell.

## Return Value

The color the receiver uses when drawing the selection highlight.

## Discussion

You should not assume that a cell would necessarily want to draw itself with the value returned from [`selectedControlColor`](/documentation/AppKit/NSColor/selectedControlColor). A cell may wish to draw with different a selection highlight color depending on such things as the key state of its `controlView`.

---

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)