<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAttributedString/Key/textHighlightColorScheme",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@NSTextHighlightColorSchemeAttributeName"
  },
  "title" : "textHighlightColorScheme"
}
-->

# textHighlightColorScheme

The custom highlight color to apply to the text.

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

## Discussion

The value of this attribute is an [`NSAttributedString.TextHighlightColorScheme`](/documentation/Foundation/NSAttributedString/TextHighlightColorScheme) structure. The default value of this attribute is `nil`, which applies the default system highlight color to the text when the [`textHighlightStyle`](/documentation/Foundation/NSAttributedString/Key/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`](/documentation/Foundation/NSAttributedString/TextHighlightColorScheme/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.

---

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)