macOS Selected Content Background
NSColor.selectedContentBackgroundColorComplete technical specification and developer reference for Selected Content Background in Apple's macOS design system. In light appearance, it resolves to HEX #0064E1; in dark appearance, it dynamically adapts to HEX #0059D1. Features wide-gamut Display P3 values, UIKit bridge (UIColor.selectedContentBackgroundColor), AppKit bridge (NSColor.selectedContentBackgroundColor), WCAG contrast audit, and Xcode drop-in initializers.
The background for selected content in a key window or view.
ColorNSColor.selectedContentBackgroundColorColor(red: 0.000, green: 0.392, blue: 0.882)Color(red: 0.000, green: 0.392, blue: 0.882, opacity: 1.00)Color(hue: 0.593, saturation: 1.000, brightness: 0.882, opacity: 1.00)Color(.displayP3, red: 0.161, green: 0.384, blue: 0.851, opacity: 1.00)Color(.sRGB, red: 0.000, green: 0.392, blue: 0.882, opacity: 1.00)Color(hex: "#0064E1")#colorLiteral(red: 0.000, green: 0.392, blue: 0.882, alpha: 1.00)Color(uiColor: UIColor(red: 0.000, green: 0.392, blue: 0.882, alpha: 1.00))Technical Color Specifications
Exact resolved HEX codes, sRGB 8-bit components, HSL, and normalized Swift floating-point decimals for Light and Dark modes.
| Color Metric / Space | Light Appearance | Dark Appearance | Swift Code Literal |
|---|---|---|---|
| HEX Code | #0064E1 | #0059D1 | Color(hex: "#0064E1") |
| sRGB (0–255) | rgb(0, 100, 225) | rgb(0, 89, 209) | (r: 0.000, g: 0.392, b: 0.882) |
| Display P3 (Wide Gamut) | P3 (0.161, 0.384, 0.851) | P3 (0.141, 0.345, 0.792) | Color(.displayP3, ...) |
| HSL / HSB | hsl(213, 100%, 44%) | hsl(214, 100%, 41%) | Color(hue:sat:bri:) |
| Platform Bridge | UIKit: UIColor.selectedContentBackgroundColor | AppKit: NSColor.selectedContentBackgroundColor | Color(uiColor:) / Color(nsColor:) |
Light Appearance
#0064E1rgb(0, 100, 225)hsl(213, 100%, 44%)(r: 0.000, g: 0.392, b: 0.882)Dark Appearance
#0059D1rgb(0, 89, 209)hsl(214, 100%, 41%)(r: 0.000, g: 0.349, b: 0.820)Drop-In Developer Snippets
Ready-to-paste code blocks for Xcode asset catalogs and Swift files.
Contents.json inside Assets.xcassets/Selected Content Background.colorset/{
"colors": [
{
"color": {
"color-space": "srgb",
"components": {
"red": "0.000",
"green": "0.392",
"blue": "0.882",
"alpha": "1.000"
}
},
"idiom": "universal"
},
{
"appearances": [
{
"appearance": "luminosity",
"value": "dark"
}
],
"color": {
"color-space": "srgb",
"components": {
"red": "0.000",
"green": "0.349",
"blue": "0.820",
"alpha": "1.000"
}
},
"idiom": "universal"
}
],
"info": {
"author": "xcode",
"version": 1
}
}Live UI Component Sandbox
Preview Color.selected content background inside standard Apple interface components.
●SwiftUI Notification
Just nowDemonstrates how Apple designers pair system background tints with dynamic Selected Content Background accents.
.foregroundStyle(NSColor.selectedContentBackgroundColor)
Platform Implementation Snippets
Ready-to-use Swift code for SwiftUI, UIKit, and AppKit applications.
// AppKit (macOS)
let button = NSButton()
button.contentTintColor = NSColor.selectedContentBackgroundColor
// Custom Layer Tint
let layer = CALayer()
layer.backgroundColor = NSColor.selectedContentBackgroundColor.cgColor
// Bridging AppKit into SwiftUI
let swiftUIColor = Color(nsColor: .selectedContentBackgroundColor)WCAG 2.1 Accessibility Contrast Audit
Contrast calculations of Selected Content Background against pure white and iOS OLED dark surfaces.
Recommended HIG Use Cases
- Standard NSWindow background canvas
- Document scroll view wells and split view panes
- Inspector sidebars and toolbar panels
Anti-Patterns to Avoid
- Foreground text content
- Hairline icon strokes
Browse More macOS Colors
Quickly jump to other Apple system colors and semantic tokens.
Frequently Asked Questions
How do I use NSColor.selectedContentBackgroundColor in macOS AppKit apps?
In AppKit, assign NSColor.selectedContentBackgroundColor to NSView, NSTextField, or NSButton styling. In SwiftUI on macOS, bridge it using Color(nsColor: .selectedContentBackgroundColor).
What is the HEX code for macOS Selected Content Background in light and dark mode?
In light appearance, Selected Content Background resolves to #0064E1. In dark appearance, it automatically adapts to #0059D1.
How do I bridge NSColor.selectedContentBackgroundColor into SwiftUI?
In SwiftUI views on macOS, instantiate Color(nsColor: .selectedContentBackgroundColor) to access the native AppKit dynamic color token.
Does Selected Content Background adapt to Dark Mode and vibrancy in macOS?
Yes, NSColor.selectedContentBackgroundColor is an appearance-aware NSColor that updates automatically when switching between light and dark modes or across vibrant desktop materials.
Why use AppKit system colors instead of hardcoded hex values?
NSColor system tokens adapt automatically to user accent color preferences, Dark Mode, and accessibility contrast settings.