Color Opacity
The Color opacity modifier
Platform Compatibility
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?
More Color Components
View allUIKit Separator Colors
The UIKit separator colors that are also used in other components, such as the TextField
UIKit Content Background colors
The UIKit colors that are also used in other components like in List and GroupBox
UIKit Text Colors
The UIKit text colors that are also used in other components, such as the TextField
Color Variants
HierarchicalShapeStyle, a shape style that maps to one of the numbered content styles
Explore Other Components
Browse allDisable Sheet Dismiss Swipe
Conditionally prevents interactive dismissal of presentations like popovers, sheets, and inspectors. Dragging the sheet is still possible to a limited extent, as shown in the screenshot, but it will never be dismissed.
Default Tab Bar Placement
Specifies the preferred placement for the tabs of a TabView in the sidebarAdaptable style on platforms where the tab bar cannot adapt between different representations, and only one representation can be shown. For example, on iOS, it can enforce the sidebar on large-screen devices like the Pro Max, and iPhone Duo. This modifier has no effect on iPadOS.