Returns a version of the gradient that will use a specified
color space for interpolating between its colors.
Rectangle().fill(.linearGradient(
colors: [.white, .blue]).colorSpace(.perceptual))
- Parameters:
- space: The color space the new gradient will use to
interpolate its constituent colors.
- Returns: A new gradient that interpolates its colors in the
specified color space.
init · iOS 16.0+
init
TypeScript
static init(gradient: Gradient): AnyGradient
Swift declaration
init(_ gradient: Gradient)
Creates a new instance from the specified gradient.