Contents

backgroundColor

The background color of the document.

Declaration

static let backgroundColor: NSAttributedString.DocumentAttributeKey

Discussion

The value of this attribute is an NSColor object representing the document-wide page background color.

The string constant in macOS 10.3 and earlier is @"BackgroundColor".

For applications linked on versions prior to macOS 10.5, HTML import sets the NSBackgroundColorDocumentAttribute to [NSColor whiteColor] in cases in which the HTML does not specify a background color. For applications linked on macOS 10.5 and later, no NSBackgroundColorDocumentAttribute is set in these cases.

See Also

Getting document appearance keys