Return Value 戻り値
A view with a color multiplication effect. ある色乗算効果でのあるビュー。
Availability 有効性
Technology
A view with a color multiplication effect. ある色乗算効果でのあるビュー。
color
The color to bias this view toward. このビューをそれへと偏らせることになる色。
The following example shows two versions of the same image side by side; at left is the original, and at right is a duplicate with the color
modifier applied with purple
.
struct InnerCircleView: View {
var body: some View {
Circle()
.fill(Color.green)
.frame(width: 40, height: 40, alignment: .center)
}
}
struct ColorMultiply: View {
var body: some View {
HStack {
Color.red.frame(width: 100, height: 100, alignment: .center)
.overlay(InnerCircleView(), alignment: .center)
.overlay(Text("Normal")
.font(.callout),
alignment: .bottom)
.border(Color.gray)
Spacer()
Color.red.frame(width: 100, height: 100, alignment: .center)
.overlay(InnerCircleView(), alignment: .center)
.colorMultiply(Color.purple)
.overlay(Text("Multiply")
.font(.callout),
alignment: .bottom)
.border(Color.gray)
}
.padding(50)
}
}