---
title: NSTextHighlightStyleAttributeName
framework: appkit
role: symbol
role_heading: Global Variable
path: appkit/nstexthighlightstyleattributename
---

# NSTextHighlightStyleAttributeName

An attribute that adds a highlight color to the text to emphasize it.

## Declaration

```occ
extern NSAttributedStringKey const NSTextHighlightStyleAttributeName;
```

## Discussion

Discussion The value of this attribute is an NSTextHighlightStyle structure. The default value of this attribute is nil, which does not add a highlight to the text. A highlight adds a background color behind the text, and adjusts the color of the text itself to contrast appropriately. The NSTextHighlightStyleDefault highlight style applies the system highlight color to your text. To apply a different color, add the NSTextHighlightColorSchemeAttributeName attribute to your text in addition to this one. Use the NSTextHighlightColorSchemeAttributeName key to specify which highlight color you want.

## See Also

### Getting text attribute keys

- [NSCursorAttributeName](appkit/nscursorattributename.md)
- [NSLinkAttributeName](appkit/nslinkattributename.md)
- [NSMarkedClauseSegmentAttributeName](appkit/nsmarkedclausesegmentattributename.md)
- [NSShadowAttributeName](appkit/nsshadowattributename.md)
- [NSSpellingStateAttributeName](appkit/nsspellingstateattributename.md)
- [NSTextAlternativesAttributeName](appkit/nstextalternativesattributename.md)
- [NSTextEffectAttributeName](appkit/nstexteffectattributename.md)
- [NSTextHighlightColorSchemeAttributeName](appkit/nstexthighlightcolorschemeattributename.md)
- [NSToolTipAttributeName](appkit/nstooltipattributename.md)
