SwiftUIでImageの色を反転させる
SwiftUIでImageの色を反転させる方法です。
.colorInvert()
を追加することで色を反転させることができます。
SDWebImage/SDWebImageSwiftUI

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
VStack { | |
Image("snorlax") | |
.colorInvert() | |
} | |
} | |
} |