SwiftUI Color.accent

.accentColor
Interactive Tint & System Accent
Adaptive System Token•iOS 13.0+, macOS 10.15+, tvOS 13.0+, watchOS 6.0+, visionOS 1.0+

Complete technical specification and developer reference for Accent in Apple's SwiftUI design system. In light appearance, it resolves to HEX #007AFF; in dark appearance, it dynamically adapts to HEX #007AFF. Features wide-gamut Display P3 values, UIKit bridge (UIColor.tintColor), AppKit bridge (NSColor.controlAccentColor), WCAG contrast audit, and Xcode drop-in initializers.

Light Mode#007AFF
Dark Mode#007AFF
Accent Color Preview

SwiftUI's accent color on the current runtime.

Color.accentColor
Copy:
Dynamic Asset
Interactive Tint & System Accent
iOS 13.0+, macOS 10.15+, tvOS 13.0+, watchOS 6.0+, visionOS 1.0+
Initializers & Color Spaces
Color(r:g:b:)Color(red: 0.000, green: 0.478, blue: 1.000)
Color(r:g:b:op:)Color(red: 0.000, green: 0.478, blue: 1.000, opacity: 1.00)
Color(hue:sat:bri:)HSBColor(hue: 0.587, saturation: 1.000, brightness: 1.000, opacity: 1.00)
Color(.displayP3)Wide GamutColor(.displayP3, red: 0.204, green: 0.471, blue: 0.965, opacity: 1.00)
Color(.sRGB)Color(.sRGB, red: 0.000, green: 0.478, blue: 1.000, opacity: 1.00)
Color(hex:)ExtensionColor(hex: "#007AFF")
#colorLiteralXcode#colorLiteral(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.00)
Color(uiColor:)iOSColor(uiColor: UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.00))
Active HEX: #007AFFP3 R: 0.204 G: 0.471 B: 0.965

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 Code#007AFF#007AFFColor(hex: "#007AFF")
sRGB (0–255)rgb(0, 122, 255)rgb(0, 122, 255)(r: 0.000, g: 0.478, b: 1.000)
Display P3 (Wide Gamut)P3 (0.204, 0.471, 0.965)P3 (0.204, 0.471, 0.965)Color(.displayP3, ...)
HSL / HSBhsl(211, 100%, 50%)hsl(211, 100%, 50%)Color(hue:sat:bri:)
Platform BridgeUIKit: UIColor.tintColorAppKit: NSColor.controlAccentColorColor(uiColor:) / Color(nsColor:)

Light Appearance

Light Theme
HEX Code
#007AFF
RGB (0–255)
rgb(0, 122, 255)
HSL
hsl(211, 100%, 50%)
Normalized Swift Literal:
(r: 0.000, g: 0.478, b: 1.000)

Dark Appearance

Dark Theme
HEX Code
#007AFF
RGB (0–255)
rgb(0, 122, 255)
HSL
hsl(211, 100%, 50%)
Normalized Swift Literal:
(r: 0.000, g: 0.478, 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/Accent.colorset/
Includes Light + Dark Modes
Contents.json
{
  "colors": [
    {
      "color": {
        "color-space": "srgb",
        "components": {
          "red": "0.000",
          "green": "0.478",
          "blue": "1.000",
          "alpha": "1.000"
        }
      },
      "idiom": "universal"
    },
    {
      "appearances": [
        {
          "appearance": "luminosity",
          "value": "dark"
        }
      ],
      "color": {
        "color-space": "srgb",
        "components": {
          "red": "0.000",
          "green": "0.478",
          "blue": "1.000",
          "alpha": "1.000"
        }
      },
      "idiom": "universal"
    }
  ],
  "info": {
    "author": "xcode",
    "version": 1
  }
}

Live UI Component Sandbox

Preview Color.accent 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 Accent accents.

Dynamic Headline in Accent

.foregroundStyle(.accentColor)

Platform Implementation Snippets

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

SwiftUI (Swift 5.9+)
// Standard SwiftUI Usage
Text("Hello, Apple")
    .foregroundStyle(Color.accentColor)

// Background & Shape Fill
RoundedRectangle(cornerRadius: 16)
    .fill(Color.accentColor)
    .frame(width: 200, height: 50)

// Prominent Action Button
Button("Confirm Action") {
    // Action
}
.buttonStyle(.borderedProminent)
.tint(Color.accentColor)

WCAG 2.1 Accessibility Contrast Audit

Contrast calculations of Accent against pure white and iOS OLED dark surfaces.

Light Mode (#007AFF)on White (#FFF)
Contrast Ratio:4.02:1
Normal Text (4.5:1 AA): Fail
Dark Mode (#007AFF)on Dark (#1C1C1E)
Contrast Ratio:4.24:1
Normal Text (4.5:1 AA): Fail

Recommended HIG Use Cases

  • Primary interactive controls and buttons
  • Navigation highlights and active tab bar items
  • Selection outlines, checkboxes, and focus rings

Anti-Patterns to Avoid

  • Non-clickable decorative fills
  • Heavy background fills that overpower foreground content

Browse More SwiftUI Colors

Quickly jump to other Apple system colors and semantic tokens.

All 18 Colors →

Frequently Asked Questions

How do I use Color.accent in SwiftUI?

In SwiftUI, apply the color directly using view modifiers like .foregroundStyle(.accentColor), .tint(.accentColor), or .background(.accentColor). You can also instantiate it via Color.accentColor.

What is the HEX code for SwiftUI Accent in light and dark mode?

In light appearance, SwiftUI Accent resolves to #007AFF. In dark appearance, it automatically adapts to #007AFF.

What is the UIKit and AppKit equivalent of SwiftUI Color.accent?

The UIKit equivalent is UIColor.tintColor (accessible in SwiftUI via Color(uiColor: .tintColor)). The AppKit equivalent is NSColor.controlAccentColor (accessible via Color(nsColor: .controlAccentColor)).

Does SwiftUI Color.accent adapt automatically to dark mode?

Yes, Color.accentColor is a dynamic Apple system token that automatically updates between light (#007AFF) and dark (#007AFF) appearances when the system appearance changes.

What is the Display P3 and sRGB value of Color.accent?

Color.accent uses resolved sRGB values (#007AFF in light, #007AFF in dark) and supports wide color gamut Display P3 coordinates for high-fidelity rendering on Apple Retina displays.