반응형
Hacking with Swift 사이트의 강좌 번역본입니다.
[원문 : https://www.hackingwithswift.com/quick-start/swiftui/how-to-blend-views-together]
How to blend views together
하나의 뷰가 다른 뷰 위에 있을때, blendMode() modifier를 사용해서 중첩되는 방법을 제어할 수 있습니다. color difference 또는 color burn을 이용하는 것 처럼, 색상들을 함께 섞을 수 있는 다양한 방법이 포함되어 있습니다 - 이전에 Core Graphics 또는 Photoshop 같은 것을 이용해 본적이 있다면 익숙할 것입니다.
이를 증명하기 위해 내부에 2개의 이미지가 있는 ZStack을 만들수 있으며, 두번째는 .multiply blend mode를 사용해서 뒷쪽 색상을 어둡게 만듭니다.
ZStack {
Image("paul-hudson")
Image("example-image")
.blendMode(.multiply)
}
반응형
'SwiftUI > Transforming views' 카테고리의 다른 글
How to adjust views by tinting, and desaturating, and more (0) | 2019.11.28 |
---|---|
How to blur a view (0) | 2019.11.27 |
How to mask one view with another (0) | 2019.11.27 |
How to adjust the accent color of a view (0) | 2019.11.27 |
How to adjust the opacity of a view (0) | 2019.11.27 |
How to round the corners of a view (0) | 2019.11.27 |
How to scale a view up or down (0) | 2019.11.27 |
How to rotate a view in 3D (0) | 2019.11.27 |