I am making an attempt to create a frosted glass impact in SwiftUI over a background picture, however the .ultraThinMaterial impact seems too white/brilliant. I wish to obtain a darker, extra refined impact like proven on this
However with the code under I get output like this:
Code:
import SwiftUI
struct ContentView: View {
var physique: some View {
ZStack {
// Background picture - centered and correctly fitted
GeometryReader { geometry in
Picture("background")
.resizable()
.aspectRatio(contentMode: .fill)
.body(width: geometry.measurement.width, peak: geometry.measurement.peak)
.clipped()
}
.ignoresSafeArea()
// A lot darker materials for refined impact
Rectangle()
.fill(.ultraThinMaterial)
.ignoresSafeArea()
}
}
}
#Preview {
ContentView()
}
Query:
How can I protect the darker tones of the background picture whereas nonetheless making use of a blur impact?
Thanks in superior!