<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSForegroundColorAttributeName",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@NSForegroundColorAttributeName"
  },
  "title" : "NSForegroundColorAttributeName"
}
-->

# NSForegroundColorAttributeName

The color of the text.

```
extern NSAttributedStringKey const NSForegroundColorAttributeName;
```

## Discussion

In macOS, the value of this attribute is an <doc://com.apple.documentation/documentation/AppKit/NSColor> instance. In iOS, tvOS, watchOS, and Mac Catalyst, the value of this attribute is a [`UIColor`](/documentation/UIKit/UIColor) instance. Use this attribute to specify the color of the text during rendering. If you don’t specify this attribute, the text renders in black.

---

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)