colorSpace(_:)
Returns a version of the gradient that will use a specified color space for interpolating between its colors.
Declaration
func colorSpace(_ space: Gradient.ColorSpace) -> AnyGradientParameters
- space:
The color space the new gradient will use to interpolate its constituent colors.
Return Value
A new gradient that interpolates its colors in the specified color space.
Discussion
Rectangle().fill(.linearGradient(
colors: [.white, .blue]).colorSpace(.perceptual))