macOS Keyboard Focus Indicator
NSColor.keyboardFocusIndicatorColorComplete technical specification and developer reference for Keyboard Focus Indicator in Apple's macOS design system. In light appearance, it resolves to HEX rgba(0, 103, 244, 0.5); in dark appearance, it dynamically adapts to HEX rgba(26, 169, 255, 0.5). Features wide-gamut Display P3 values, UIKit bridge (UIColor.keyboardFocusIndicatorColor), AppKit bridge (NSColor.keyboardFocusIndicatorColor), WCAG contrast audit, and Xcode drop-in initializers.
The ring around the currently focused control when using keyboard navigation.
ColorNSColor.keyboardFocusIndicatorColorColor(red: 0.000, green: 0.404, blue: 0.957)Color(red: 0.000, green: 0.404, blue: 0.957, opacity: 0.50)Color(hue: 0.596, saturation: 1.000, brightness: 0.957, opacity: 0.50)Color(.displayP3, red: 0.169, green: 0.396, blue: 0.922, opacity: 0.50)Color(.sRGB, red: 0.000, green: 0.404, blue: 0.957, opacity: 0.50)Color(hex: "rgba(0, 103, 244, 0.5)")#colorLiteral(red: 0.000, green: 0.404, blue: 0.957, alpha: 0.50)Color(uiColor: UIColor(red: 0.000, green: 0.404, blue: 0.957, alpha: 0.50))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 | rgba(0, 103, 244, 0.5) | rgba(26, 169, 255, 0.5) | Color(hex: "rgba(0, 103, 244, 0.5)") |
| sRGB (0–255) | rgba(0, 103, 244, 0.5) | rgba(26, 169, 255, 0.5) | (r: 0.000, g: 0.404, b: 0.957) |
| Display P3 (Wide Gamut) | P3 (0.169, 0.396, 0.922) | P3 (0.310, 0.655, 0.973) | Color(.displayP3, ...) |
| HSL / HSB | hsla(215, 100%, 48%, 0.5) | hsla(203, 100%, 55%, 0.5) | Color(hue:sat:bri:) |
| Platform Bridge | UIKit: UIColor.keyboardFocusIndicatorColor | AppKit: NSColor.keyboardFocusIndicatorColor | Color(uiColor:) / Color(nsColor:) |
Light Appearance
rgba(0, 103, 244, 0.5)rgba(0, 103, 244, 0.5)hsla(215, 100%, 48%, 0.5)(r: 0.000, g: 0.404, b: 0.957)Dark Appearance
rgba(26, 169, 255, 0.5)rgba(26, 169, 255, 0.5)hsla(203, 100%, 55%, 0.5)(r: 0.102, g: 0.663, b: 1.000)Drop-In Developer Snippets
Ready-to-paste code blocks for Xcode asset catalogs and Swift files.
Contents.json inside Assets.xcassets/Keyboard Focus Indicator.colorset/{
"colors": [
{
"color": {
"color-space": "srgb",
"components": {
"red": "0.000",
"green": "0.404",
"blue": "0.957",
"alpha": "0.500"
}
},
"idiom": "universal"
},
{
"appearances": [
{
"appearance": "luminosity",
"value": "dark"
}
],
"color": {
"color-space": "srgb",
"components": {
"red": "0.102",
"green": "0.663",
"blue": "1.000",
"alpha": "0.500"
}
},
"idiom": "universal"
}
],
"info": {
"author": "xcode",
"version": 1
}
}Live UI Component Sandbox
Preview Color.keyboard focus indicator inside standard Apple interface components.
●SwiftUI Notification
Just nowDemonstrates how Apple designers pair system background tints with dynamic Keyboard Focus Indicator accents.
.foregroundStyle(NSColor.keyboardFocusIndicatorColor)
Platform Implementation Snippets
Ready-to-use Swift code for SwiftUI, UIKit, and AppKit applications.
// AppKit (macOS)
let button = NSButton()
button.contentTintColor = NSColor.keyboardFocusIndicatorColor
// Custom Layer Tint
let layer = CALayer()
layer.backgroundColor = NSColor.keyboardFocusIndicatorColor.cgColor
// Bridging AppKit into SwiftUI
let swiftUIColor = Color(nsColor: .keyboardFocusIndicatorColor)WCAG 2.1 Accessibility Contrast Audit
Contrast calculations of Keyboard Focus Indicator against pure white and iOS OLED dark surfaces.
Recommended HIG Use Cases
- AppKit desktop interfaces
- macOS native controls
- Dark Mode & Vibrant surfaces
Anti-Patterns to Avoid
- Hardcoded static hex values when appearance-aware adaptation is needed
Browse More macOS Colors
Quickly jump to other Apple system colors and semantic tokens.
Frequently Asked Questions
How do I use NSColor.keyboardFocusIndicatorColor in macOS AppKit apps?
In AppKit, assign NSColor.keyboardFocusIndicatorColor to NSView, NSTextField, or NSButton styling. In SwiftUI on macOS, bridge it using Color(nsColor: .keyboardFocusIndicatorColor).
What is the HEX code for macOS Keyboard Focus Indicator in light and dark mode?
In light appearance, Keyboard Focus Indicator resolves to rgba(0, 103, 244, 0.5). In dark appearance, it automatically adapts to rgba(26, 169, 255, 0.5).
How do I bridge NSColor.keyboardFocusIndicatorColor into SwiftUI?
In SwiftUI views on macOS, instantiate Color(nsColor: .keyboardFocusIndicatorColor) to access the native AppKit dynamic color token.
Does Keyboard Focus Indicator adapt to Dark Mode and vibrancy in macOS?
Yes, NSColor.keyboardFocusIndicatorColor 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.