For the Vision Pro, using the default app windows, how does one change the background color of the glass? I saw some apps had a blue background but I'm not seeing how to do it or at least maybe I am doing it but the simulator isn't showing it.

I don't believe there is a way to do this on the window itself but you can change the entire background color by setting the background color on your View:
@main
struct InkwellApp: App {
var body: some Scene {
WindowGroup(id: "mail-viewer") {
ContentView()
.background(.blue)
.ignoresSafeArea()
}
}
}
And then make the View take up all of the vertical and horizontal space using Spacers:
struct ContentView: View {
var body: some View {
VStack {
Spacer()
Model3D(named: "Scene", bundle: realityKitContentBundle)
.padding(.bottom, 50)
HStack {
Spacer()
ExtractedView()
Spacer()
}
Spacer()
}
.padding()
}
}

You can get a similar effect to what you shared in your image by using a background color with a smaller opacity value like this:
.background(.blue.opacity(0.2))

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With