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

# backgroundColor

The background color for the image.

```
@NSCopying var backgroundColor: NSColor { get set }
```

## Discussion

The background color is visible only if the drawn image representation does not completely cover all of the pixels available for the image’s current size.  The background color is ignored for cached image representations; such caches are always created with a white background. Assigning a new background color does not cause the receiver to recache itself.

The default color is transparent, as returned by the [`clear`](/documentation/AppKit/NSColor/clear) method of `NSColor`.

## See Also

[`-  recache`](/documentation/AppKit/NSImage/recache())

Invalidates and frees offscreen caches of all image representations.



---

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)