Color Opacity
The Color opacity modifier
Platform Compatibility
iOS 16.0+ iPadOS 16.0+ macOS 13.0+ watchOS 9.0+ tvOS 16.0+ visionOS 1.0+
Tags
SwiftUI Code
HStack {
smallRect
.foregroundStyle(.blue.opacity(1))
smallRect
.foregroundStyle(.blue.opacity(0.7))
smallRect
.foregroundStyle(.blue.opacity(0.5))
smallRect
.foregroundStyle(.blue.opacity(0.3))
smallRect
.foregroundStyle(.blue.opacity(0.1))
}
Found an issue or have a suggestion?
Created: May 29, 2025Updated: May 29, 2025