macOS Keyboard Focus Indicator

NSColor.keyboardFocusIndicatorColor
macOS System Color
Adaptive System Token•macOS 10.10+ / 10.14+, AppKit

Complete 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.

Light Modergba(0, 103, 244, 0.5)
Dark Modergba(26, 169, 255, 0.5)
Keyboard Focus Indicator Color Preview

The ring around the currently focused control when using keyboard navigation.

ColorNSColor.keyboardFocusIndicatorColor
Copy:
Dynamic Asset
macOS System Color
macOS 10.10+ / 10.14+, AppKit
Initializers & Color Spaces
Color(r:g:b:)Color(red: 0.000, green: 0.404, blue: 0.957)
Color(r:g:b:op:)Color(red: 0.000, green: 0.404, blue: 0.957, opacity: 0.50)
Color(hue:sat:bri:)HSBColor(hue: 0.596, saturation: 1.000, brightness: 0.957, opacity: 0.50)
Color(.displayP3)Wide GamutColor(.displayP3, red: 0.169, green: 0.396, blue: 0.922, opacity: 0.50)
Color(.sRGB)Color(.sRGB, red: 0.000, green: 0.404, blue: 0.957, opacity: 0.50)
Color(hex:)ExtensionColor(hex: "rgba(0, 103, 244, 0.5)")
#colorLiteralXcode#colorLiteral(red: 0.000, green: 0.404, blue: 0.957, alpha: 0.50)
Color(uiColor:)iOSColor(uiColor: UIColor(red: 0.000, green: 0.404, blue: 0.957, alpha: 0.50))
Active HEX: rgba(0, 103, 244, 0.5)P3 R: 0.169 G: 0.396 B: 0.922

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 / SpaceLight AppearanceDark AppearanceSwift Code Literal
HEX Codergba(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 / HSBhsla(215, 100%, 48%, 0.5)hsla(203, 100%, 55%, 0.5)Color(hue:sat:bri:)
Platform BridgeUIKit: UIColor.keyboardFocusIndicatorColorAppKit: NSColor.keyboardFocusIndicatorColorColor(uiColor:) / Color(nsColor:)

Light Appearance

Light Theme
HEX Code
rgba(0, 103, 244, 0.5)
RGB (0–255)
rgba(0, 103, 244, 0.5)
HSL
hsla(215, 100%, 48%, 0.5)
Normalized Swift Literal:
(r: 0.000, g: 0.404, b: 0.957)

Dark Appearance

Dark Theme
HEX Code
rgba(26, 169, 255, 0.5)
RGB (0–255)
rgba(26, 169, 255, 0.5)
HSL
hsla(203, 100%, 55%, 0.5)
Normalized Swift Literal:
(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.

Xcode Location: Save as Contents.json inside Assets.xcassets/Keyboard Focus Indicator.colorset/
Includes Light + Dark Modes
Contents.json
{
  "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.

Interactive Controls
Active TagBadge 99+
Toggle Tint
Container & Typography Styling

●SwiftUI Notification

Just now

Demonstrates how Apple designers pair system background tints with dynamic Keyboard Focus Indicator accents.

Dynamic Headline in Keyboard Focus Indicator

.foregroundStyle(NSColor.keyboardFocusIndicatorColor)

Platform Implementation Snippets

Ready-to-use Swift code for SwiftUI, UIKit, and AppKit applications.

AppKit (macOS Swift)
// 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.

Light Mode (rgba(0, 103, 244, 0.5))on White (#FFF)
Contrast Ratio:2.15:1
Normal Text (4.5:1 AA): Fail
Dark Mode (rgba(26, 169, 255, 0.5))on Dark (#1C1C1E)
Contrast Ratio:2.62:1
Normal Text (4.5:1 AA): Fail

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

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.