SwiftUI Color.gray

.gray
Neutral Dividers, Disabled & Inactive
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 Gray in Apple's SwiftUI design system. In light appearance, it resolves to HEX #8E8E93; in dark appearance, it dynamically adapts to HEX #8E8E93. Features wide-gamut Display P3 values, UIKit bridge (UIColor.systemGray), AppKit bridge (NSColor.systemGray), WCAG contrast audit, and Xcode drop-in initializers.

Light Mode#8E8E93
Dark Mode#8E8E93
Gray Color Preview

SwiftUI's neutral gray.

Color.gray
Copy:
Dynamic Asset
Neutral Dividers, Disabled & Inactive
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.557, green: 0.557, blue: 0.576)
Color(r:g:b:op:)Color(red: 0.557, green: 0.557, blue: 0.576, opacity: 1.00)
Color(hue:sat:bri:)HSBColor(hue: 0.667, saturation: 0.034, brightness: 0.576, opacity: 1.00)
Color(.displayP3)Wide GamutColor(.displayP3, red: 0.557, green: 0.557, blue: 0.576, opacity: 1.00)
Color(.sRGB)Color(.sRGB, red: 0.557, green: 0.557, blue: 0.576, opacity: 1.00)
Color(hex:)ExtensionColor(hex: "#8E8E93")
#colorLiteralXcode#colorLiteral(red: 0.557, green: 0.557, blue: 0.576, alpha: 1.00)
Color(uiColor:)iOSColor(uiColor: UIColor(red: 0.557, green: 0.557, blue: 0.576, alpha: 1.00))
Active HEX: #8E8E93P3 R: 0.557 G: 0.557 B: 0.576

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#8E8E93#8E8E93Color(hex: "#8E8E93")
sRGB (0–255)rgb(142, 142, 147)rgb(142, 142, 147)(r: 0.557, g: 0.557, b: 0.576)
Display P3 (Wide Gamut)P3 (0.557, 0.557, 0.576)P3 (0.557, 0.557, 0.576)Color(.displayP3, ...)
HSL / HSBhsl(240, 2%, 57%)hsl(240, 2%, 57%)Color(hue:sat:bri:)
Platform BridgeUIKit: UIColor.systemGrayAppKit: NSColor.systemGrayColor(uiColor:) / Color(nsColor:)

Light Appearance

Light Theme
HEX Code
#8E8E93
RGB (0–255)
rgb(142, 142, 147)
HSL
hsl(240, 2%, 57%)
Normalized Swift Literal:
(r: 0.557, g: 0.557, b: 0.576)

Dark Appearance

Dark Theme
HEX Code
#8E8E93
RGB (0–255)
rgb(142, 142, 147)
HSL
hsl(240, 2%, 57%)
Normalized Swift Literal:
(r: 0.557, g: 0.557, b: 0.576)

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/Gray.colorset/
Includes Light + Dark Modes
Contents.json
{
  "colors": [
    {
      "color": {
        "color-space": "srgb",
        "components": {
          "red": "0.557",
          "green": "0.557",
          "blue": "0.576",
          "alpha": "1.000"
        }
      },
      "idiom": "universal"
    },
    {
      "appearances": [
        {
          "appearance": "luminosity",
          "value": "dark"
        }
      ],
      "color": {
        "color-space": "srgb",
        "components": {
          "red": "0.557",
          "green": "0.557",
          "blue": "0.576",
          "alpha": "1.000"
        }
      },
      "idiom": "universal"
    }
  ],
  "info": {
    "author": "xcode",
    "version": 1
  }
}

Live UI Component Sandbox

Preview Color.gray 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 Gray accents.

Dynamic Headline in Gray

.foregroundStyle(.gray)

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.gray)

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

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

WCAG 2.1 Accessibility Contrast Audit

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

Light Mode (#8E8E93)on White (#FFF)
Contrast Ratio:3.26:1
Normal Text (4.5:1 AA): Fail
Dark Mode (#8E8E93)on Dark (#1C1C1E)
Contrast Ratio:5.22:1
Normal Text (4.5:1 AA): Pass (AA)

Recommended HIG Use Cases

  • Dividers, separators, and card outlines
  • Disabled buttons and placeholder text
  • Empty state illustrations and inactive tabs

Anti-Patterns to Avoid

  • High-priority interactive elements

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.gray in SwiftUI?

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

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

In light appearance, SwiftUI Gray resolves to #8E8E93. In dark appearance, it automatically adapts to #8E8E93.

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

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

Does SwiftUI Color.gray adapt automatically to dark mode?

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

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

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