Contents

foregroundColor

The color of the text.

Declaration

static let foregroundColor: NSAttributedString.Key

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