---
title: "highlight(withLevel:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolor/highlight(withlevel:)"
---

# highlight(withLevel:)

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

## Declaration

```swift
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

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

## Discussion

Discussion The highlight color is provided by the highlightColor property. Call this method when you want to brighten the current color for use in highlights.

## See Also

### Transforming existing color objects

- [usingColorSpace(_:)](appkit/nscolor/usingcolorspace(_:).md)
- [blended(withFraction:of:)](appkit/nscolor/blended(withfraction:of:).md)
- [withAlphaComponent(_:)](appkit/nscolor/withalphacomponent(_:).md)
- [shadow(withLevel:)](appkit/nscolor/shadow(withlevel:).md)
