---
title: textHighlightColorScheme
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/nsattributedstring/key/texthighlightcolorscheme
---

# textHighlightColorScheme

The custom highlight color to apply to the text.

## Declaration

```swift
static let textHighlightColorScheme: NSAttributedString.Key
```

## Discussion

Discussion The value of this attribute is an NSAttributedString.TextHighlightColorScheme structure. The default value of this attribute is nil, which applies the default system highlight color to the text when the textHighlightStyle attribute is present. A highlight adds a background color behind the text, and applies a contrasting foreground color to the text itself. Set the value of this attribute to default, or don’t specify the attribute at all, to apply a highlight with the default system color. Specify a different value for this attribute to apply that highlight color instead.

## See Also

### Getting text attribute keys

- [cursor](foundation/nsattributedstring/key/cursor.md)
- [link](foundation/nsattributedstring/key/link.md)
- [markedClauseSegment](foundation/nsattributedstring/key/markedclausesegment.md)
- [replacementIndex](foundation/nsattributedstring/key/replacementindex.md)
- [shadow](foundation/nsattributedstring/key/shadow.md)
- [spellingState](foundation/nsattributedstring/key/spellingstate.md)
- [suggestionHighlight](foundation/nsattributedstring/key/suggestionhighlight.md)
- [textAlternatives](foundation/nsattributedstring/key/textalternatives.md)
- [textEffect](foundation/nsattributedstring/key/texteffect.md)
- [textHighlightStyle](foundation/nsattributedstring/key/texthighlightstyle.md)
- [textItemTag](foundation/nsattributedstring/key/textitemtag.md)
- [toolTip](foundation/nsattributedstring/key/tooltip.md)
