opacity

Multiplies the opacity of the color by the given amount.

Color ModifieriOS 13.0+macOS 10.15+tvOS 13.0+watchOS 6.0+opacity(_:) in SwiftUI

Declaration

React
compose().opacity(opacity: number)
Swift
func opacity(_ opacity: Double) -> Color

Parameters

  • opacity*number

    The amount by which to multiply the opacity of the color.

Return value

A view with modified opacity.

See also

More in Color modifiers.