Gradients
LinearGradient
RoundedRectangle(cornerRadius: 16.0)
.fill(
LinearGradient(
colors: [Color.red, Color.blue],
startPoint: .topLeading,
endPoint: .bottomTrailing
)
)
.frame(width: 300, height: 200)
RadialGradient
RoundedRectangle(cornerRadius: 16.0)
.fill(
RadialGradient(
colors: [Color.red, Color.blue],
center: .center,
startRadius: 80.0,
endRadius: 160.0)
)
)
.frame(width: 300, height: 200)
AngularGradient
RoundedRectangle(cornerRadius: 16.0)
.fill(
AngularGradient(
colors: [Color.red, Color.blue],
center: .center,
angle: .degrees(180)
)
)
.frame(width: 300, height: 200)