<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextField/textColor",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextField(py)textColor"
  },
  "title" : "textColor"
}
-->

# textColor

The color of the text field’s content.

```
@NSCopying var textColor: NSColor? { get set }
```

## Discussion

> Note:
> When the text field has an attributed string value, the system ignores the ``doc://com.apple.appkit/documentation/AppKit/NSTextField/textColor``, ``doc://com.apple.appkit/documentation/AppKit/NSControl/font``, ``doc://com.apple.appkit/documentation/AppKit/NSControl/alignment``, ``doc://com.apple.appkit/documentation/AppKit/NSControl/lineBreakMode``, and `lineBreakStrategy` properties. Set the <doc://com.apple.documentation/documentation/Foundation/NSAttributedString/Key/foregroundColor>, <doc://com.apple.documentation/documentation/Foundation/NSAttributedString/Key/font>, ``doc://com.apple.appkit/documentation/AppKit/NSMutableParagraphStyle/alignment``, ``doc://com.apple.appkit/documentation/AppKit/NSParagraphStyle/lineBreakMode``, and ``doc://com.apple.appkit/documentation/AppKit/NSParagraphStyle/lineBreakStrategy-swift.property`` properties in the attributed string instead.

## See Also

[`backgroundColor`](/documentation/AppKit/NSTextField/backgroundColor)

The color of the background the text field’s cell draws behind the text.

[`textColor`](/documentation/AppKit/NSTextFieldCell/textColor)

The color to use to draw the cell’s text.



---

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)