Give large images a background in darkmode when they are dark

This commit is contained in:
Maurice Parker 2019-09-30 02:48:51 -05:00
parent 8d0bfd9b47
commit 37418471bc
1 changed files with 15 additions and 8 deletions

View File

@ -24,10 +24,9 @@ struct FeedInspectorView : View {
Spacer()
if self.viewModel.image.size.width < 32 || self.viewModel.image.size.height < 32 {
if colorScheme == .dark && self.viewModel.image.isDark() {
ZStack {
Color(AppAssets.avatarBackgroundColor)
Image(uiImage: self.viewModel.image).resizable()
}
Image(uiImage: self.viewModel.image)
.resizable()
.background(Color(AppAssets.avatarBackgroundColor))
.frame(width: 24.0, height: 24.0)
.cornerRadius(2.0)
} else {
@ -37,10 +36,18 @@ struct FeedInspectorView : View {
.cornerRadius(2.0)
}
} else {
Image(uiImage: self.viewModel.image)
.resizable()
.frame(width: 48.0, height: 48.0)
.cornerRadius(5.0)
if colorScheme == .dark && self.viewModel.image.isDark() {
Image(uiImage: self.viewModel.image)
.resizable()
.background(Color(AppAssets.avatarBackgroundColor))
.frame(width: 48.0, height: 48.0)
.cornerRadius(5.0)
} else {
Image(uiImage: self.viewModel.image)
.resizable()
.frame(width: 48.0, height: 48.0)
.cornerRadius(5.0)
}
}
Spacer()
}) {