---
title: NSForegroundColorAttributeName
framework: uikit
role: symbol
role_heading: Global Variable
path: uikit/nsforegroundcolorattributename
---

# NSForegroundColorAttributeName

The color of the text.

## Declaration

```occ
extern NSAttributedStringKey const NSForegroundColorAttributeName;
```

## Discussion

Discussion In macOS, the value of this attribute is an NSColor instance. In iOS, tvOS, watchOS, and Mac Catalyst, the value of this attribute is a 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.

## See Also

### Getting rendering attribute keys

- [NSBackgroundColorAttributeName](uikit/nsbackgroundcolorattributename.md)
- [NSBaselineOffsetAttributeName](uikit/nsbaselineoffsetattributename.md)
- [NSFontAttributeName](uikit/nsfontattributename.md)
- [NSKernAttributeName](uikit/nskernattributename.md)
- [NSLigatureAttributeName](uikit/nsligatureattributename.md)
- [NSParagraphStyleAttributeName](uikit/nsparagraphstyleattributename.md)
- [NSStrikethroughColorAttributeName](uikit/nsstrikethroughcolorattributename.md)
- [NSStrikethroughStyleAttributeName](uikit/nsstrikethroughstyleattributename.md)
- [NSStrokeColorAttributeName](uikit/nsstrokecolorattributename.md)
- [NSStrokeWidthAttributeName](uikit/nsstrokewidthattributename.md)
- [NSTrackingAttributeName](uikit/nstrackingattributename.md)
- [NSUnderlineColorAttributeName](uikit/nsunderlinecolorattributename.md)
- [NSUnderlineStyleAttributeName](uikit/nsunderlinestyleattributename.md)
- [NSWritingDirectionAttributeName](uikit/nswritingdirectionattributename.md)
