SwiftUI Color.black

.black
Absolute Monochromatic Black
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 Black in Apple's SwiftUI design system. In light appearance, it resolves to HEX #000000; in dark appearance, it dynamically adapts to HEX #000000. Features wide-gamut Display P3 values, UIKit bridge (UIColor.black), AppKit bridge (NSColor.black), WCAG contrast audit, and Xcode drop-in initializers.

Light Mode#000000
Dark Mode#000000
Black Color Preview

Pure black.

Color.black
Copy:
Dynamic Asset
Absolute Monochromatic Black
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.000, blue: 0.000)
Color(r:g:b:op:)Color(red: 0.000, green: 0.000, blue: 0.000, opacity: 1.00)
Color(hue:sat:bri:)HSBColor(hue: 0.000, saturation: 0.000, brightness: 0.000, opacity: 1.00)
Color(.displayP3)Wide GamutColor(.displayP3, red: 0.000, green: 0.000, blue: 0.000, opacity: 1.00)
Color(.sRGB)Color(.sRGB, red: 0.000, green: 0.000, blue: 0.000, opacity: 1.00)
Color(hex:)ExtensionColor(hex: "#000000")
#colorLiteralXcode#colorLiteral(red: 0.000, green: 0.000, blue: 0.000, alpha: 1.00)
Color(uiColor:)iOSColor(uiColor: UIColor(red: 0.000, green: 0.000, blue: 0.000, alpha: 1.00))
Active HEX: #000000P3 R: 0.000 G: 0.000 B: 0.000

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#000000#000000Color(hex: "#000000")
sRGB (0–255)rgb(0, 0, 0)rgb(0, 0, 0)(r: 0.000, g: 0.000, b: 0.000)
Display P3 (Wide Gamut)P3 (0.000, 0.000, 0.000)P3 (0.000, 0.000, 0.000)Color(.displayP3, ...)
HSL / HSBhsl(0, 0%, 0%)hsl(0, 0%, 0%)Color(hue:sat:bri:)
Platform BridgeUIKit: UIColor.blackAppKit: NSColor.blackColor(uiColor:) / Color(nsColor:)

Light Appearance

Light Theme
HEX Code
#000000
RGB (0–255)
rgb(0, 0, 0)
HSL
hsl(0, 0%, 0%)
Normalized Swift Literal:
(r: 0.000, g: 0.000, b: 0.000)

Dark Appearance

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

Live UI Component Sandbox

Preview Color.black 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 Black accents.

Dynamic Headline in Black

.foregroundStyle(.black)

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

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

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

WCAG 2.1 Accessibility Contrast Audit

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

Light Mode (#000000)on White (#FFF)
Contrast Ratio:21.00:1
Normal Text (4.5:1 AA): Pass (AA)
Dark Mode (#000000)on Dark (#1C1C1E)
Contrast Ratio:1.23:1
Normal Text (4.5:1 AA): Fail

Recommended HIG Use Cases

  • OLED true black backgrounds and borders
  • High-contrast monochromatic styles
  • Fixed dark elements that should not invert

Anti-Patterns to Avoid

  • Direct use where adaptive dark mode inversion is expected (use Color.primary instead)

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

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

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

In light appearance, SwiftUI Black resolves to #000000. In dark appearance, it automatically adapts to #000000.

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

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

Does SwiftUI Color.black adapt automatically to dark mode?

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

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

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