Gradient
작성일
전체 화면 중심으로
LinearGradient(gradient: Gradient(colors: [.white, .black]), startPoint: .top, endPoint: .bottom)
또는
LinearGradient(gradient: Gradient(stops: [
Gradient.Stop(color: .white, location: 0.45),
Gradient.Stop(color: .black, location: 0.55),
]), startPoint: .top, endPoint: .bottom)
이런식으로 필요한 색상 부분을 정할 수도 있다.
원형 중심으로
RadialGradient(gradient: Gradient(colors: [.blue, .black]), center: .center, startRadius: 20, endRadius: 200)
점 중심으로
AngularGradient(gradient: Gradient(colors: [.red, .yellow, .green, .blue, .purple, .red]), center: .center)