SwiftUI Color.green
.greenComplete technical specification and developer reference for Green in Apple's SwiftUI design system. In light appearance, it resolves to HEX #34C759; in dark appearance, it dynamically adapts to HEX #30D158. Features wide-gamut Display P3 values, UIKit bridge (UIColor.systemGreen), AppKit bridge (NSColor.systemGreen), WCAG contrast audit, and Xcode drop-in initializers.
SwiftUI's adaptable green.
Color.greenColor(red: 0.204, green: 0.780, blue: 0.349)Color(red: 0.204, green: 0.780, blue: 0.349, opacity: 1.00)Color(hue: 0.375, saturation: 0.739, brightness: 0.780, opacity: 1.00)Color(.displayP3, red: 0.396, green: 0.769, blue: 0.400, opacity: 1.00)Color(.sRGB, red: 0.204, green: 0.780, blue: 0.349, opacity: 1.00)Color(hex: "#34C759")#colorLiteral(red: 0.204, green: 0.780, blue: 0.349, alpha: 1.00)Color(uiColor: UIColor(red: 0.204, green: 0.780, blue: 0.349, alpha: 1.00))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 / Space | Light Appearance | Dark Appearance | Swift Code Literal |
|---|---|---|---|
| HEX Code | #34C759 | #30D158 | Color(hex: "#34C759") |
| sRGB (0–255) | rgb(52, 199, 89) | rgb(48, 209, 88) | (r: 0.204, g: 0.780, b: 0.349) |
| Display P3 (Wide Gamut) | P3 (0.396, 0.769, 0.400) | P3 (0.408, 0.808, 0.404) | Color(.displayP3, ...) |
| HSL / HSB | hsl(135, 59%, 49%) | hsl(135, 64%, 50%) | Color(hue:sat:bri:) |
| Platform Bridge | UIKit: UIColor.systemGreen | AppKit: NSColor.systemGreen | Color(uiColor:) / Color(nsColor:) |
Light Appearance
#34C759rgb(52, 199, 89)hsl(135, 59%, 49%)(r: 0.204, g: 0.780, b: 0.349)Dark Appearance
#30D158rgb(48, 209, 88)hsl(135, 64%, 50%)(r: 0.188, g: 0.820, b: 0.345)Drop-In Developer Snippets
Ready-to-paste code blocks for Xcode asset catalogs and Swift files.
Contents.json inside Assets.xcassets/Green.colorset/{
"colors": [
{
"color": {
"color-space": "srgb",
"components": {
"red": "0.204",
"green": "0.780",
"blue": "0.349",
"alpha": "1.000"
}
},
"idiom": "universal"
},
{
"appearances": [
{
"appearance": "luminosity",
"value": "dark"
}
],
"color": {
"color-space": "srgb",
"components": {
"red": "0.188",
"green": "0.820",
"blue": "0.345",
"alpha": "1.000"
}
},
"idiom": "universal"
}
],
"info": {
"author": "xcode",
"version": 1
}
}Live UI Component Sandbox
Preview Color.green inside standard Apple interface components.
●SwiftUI Notification
Just nowDemonstrates how Apple designers pair system background tints with dynamic Green accents.
.foregroundStyle(.green)
Platform Implementation Snippets
Ready-to-use Swift code for SwiftUI, UIKit, and AppKit applications.
// Standard SwiftUI Usage
Text("Hello, Apple")
.foregroundStyle(Color.green)
// Background & Shape Fill
RoundedRectangle(cornerRadius: 16)
.fill(Color.green)
.frame(width: 200, height: 50)
// Prominent Action Button
Button("Confirm Action") {
// Action
}
.buttonStyle(.borderedProminent)
.tint(Color.green)WCAG 2.1 Accessibility Contrast Audit
Contrast calculations of Green against pure white and iOS OLED dark surfaces.
Recommended HIG Use Cases
- Success feedback, confirmations, and completed tasks
- Positive financial gains and statistics
- Fitness tracking rings and active status indicators
Anti-Patterns to Avoid
- Critical error alerts
- Sole indicator of state without supporting iconography
Browse More SwiftUI Colors
Quickly jump to other Apple system colors and semantic tokens.
Frequently Asked Questions
How do I use Color.green in SwiftUI?
In SwiftUI, apply the color directly using view modifiers like .foregroundStyle(.green), .tint(.green), or .background(.green). You can also instantiate it via Color.green.
What is the HEX code for SwiftUI Green in light and dark mode?
In light appearance, SwiftUI Green resolves to #34C759. In dark appearance, it automatically adapts to #30D158.
What is the UIKit and AppKit equivalent of SwiftUI Color.green?
The UIKit equivalent is UIColor.systemGreen (accessible in SwiftUI via Color(uiColor: .systemGreen)). The AppKit equivalent is NSColor.systemGreen (accessible via Color(nsColor: .systemGreen)).
Does SwiftUI Color.green adapt automatically to dark mode?
Yes, Color.green is a dynamic Apple system token that automatically updates between light (#34C759) and dark (#30D158) appearances when the system appearance changes.
What is the Display P3 and sRGB value of Color.green?
Color.green uses resolved sRGB values (#34C759 in light, #30D158 in dark) and supports wide color gamut Display P3 coordinates for high-fidelity rendering on Apple Retina displays.