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

# highlight(withLevel:)

Creates a new color object that represents a blend between the current color and the highlight color.

```
func highlight(withLevel val: CGFloat) -> NSColor?
```

## Parameters

`val`

The amount of the highlight color that is blended with the receiver’s color. This should be a number from `0.0` through `1.0`. A `highlightLevel` below `0.0` is interpreted as `0.0`; a `highlightLevel` above `1.0` is interpreted as `1.0`.

## Return Value

The new `NSColor` object. Returns `nil` if the colors can’t be converted.

## Discussion

The highlight color is provided by the [`highlightColor`](/documentation/AppKit/NSColor/highlightColor) property. Call this method when you want to brighten the current color for use in highlights.

---

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)