SwiftUI Color.purple

.purple
Media, Entertainment & Special States
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 Purple in Apple's SwiftUI design system. In light appearance, it resolves to HEX #CB30E0; in dark appearance, it dynamically adapts to HEX #DB34F2. Features wide-gamut Display P3 values, UIKit bridge (UIColor.systemPurple), AppKit bridge (NSColor.systemPurple), WCAG contrast audit, and Xcode drop-in initializers.

Light Mode#CB30E0
Dark Mode#DB34F2
Purple Color Preview

SwiftUI's adaptable purple.

Color.purple
Copy:
Dynamic Asset
Media, Entertainment & Special States
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.796, green: 0.188, blue: 0.878)
Color(r:g:b:op:)Color(red: 0.796, green: 0.188, blue: 0.878, opacity: 1.00)
Color(hue:sat:bri:)HSBColor(hue: 0.813, saturation: 0.786, brightness: 0.878, opacity: 1.00)
Color(.displayP3)Wide GamutColor(.displayP3, red: 0.733, green: 0.243, blue: 0.851, opacity: 1.00)
Color(.sRGB)Color(.sRGB, red: 0.796, green: 0.188, blue: 0.878, opacity: 1.00)
Color(hex:)ExtensionColor(hex: "#CB30E0")
#colorLiteralXcode#colorLiteral(red: 0.796, green: 0.188, blue: 0.878, alpha: 1.00)
Color(uiColor:)iOSColor(uiColor: UIColor(red: 0.796, green: 0.188, blue: 0.878, alpha: 1.00))
Active HEX: #CB30E0P3 R: 0.733 G: 0.243 B: 0.851

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#CB30E0#DB34F2Color(hex: "#CB30E0")
sRGB (0–255)rgb(203, 48, 224)rgb(219, 52, 242)(r: 0.796, g: 0.188, b: 0.878)
Display P3 (Wide Gamut)P3 (0.733, 0.243, 0.851)P3 (0.792, 0.263, 0.918)Color(.displayP3, ...)
HSL / HSBhsl(293, 74%, 53%)hsl(293, 88%, 58%)Color(hue:sat:bri:)
Platform BridgeUIKit: UIColor.systemPurpleAppKit: NSColor.systemPurpleColor(uiColor:) / Color(nsColor:)

Light Appearance

Light Theme
HEX Code
#CB30E0
RGB (0–255)
rgb(203, 48, 224)
HSL
hsl(293, 74%, 53%)
Normalized Swift Literal:
(r: 0.796, g: 0.188, b: 0.878)

Dark Appearance

Dark Theme
HEX Code
#DB34F2
RGB (0–255)
rgb(219, 52, 242)
HSL
hsl(293, 88%, 58%)
Normalized Swift Literal:
(r: 0.859, g: 0.204, b: 0.949)

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

Live UI Component Sandbox

Preview Color.purple 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 Purple accents.

Dynamic Headline in Purple

.foregroundStyle(.purple)

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

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

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

WCAG 2.1 Accessibility Contrast Audit

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

Light Mode (#CB30E0)on White (#FFF)
Contrast Ratio:4.17:1
Normal Text (4.5:1 AA): Fail
Dark Mode (#DB34F2)on Dark (#1C1C1E)
Contrast Ratio:4.69:1
Normal Text (4.5:1 AA): Pass (AA)

Recommended HIG Use Cases

  • Media categories, podcasts, and video hubs
  • VIP, pro, or premium feature badges
  • Data visualization and chart groupings

Anti-Patterns to Avoid

  • Destructive actions
  • Primary body copy

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

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

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

In light appearance, SwiftUI Purple resolves to #CB30E0. In dark appearance, it automatically adapts to #DB34F2.

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

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

Does SwiftUI Color.purple adapt automatically to dark mode?

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

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

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