Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In visionOS, how does one change the Window glass color?

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.

Showing vision pro image of blue background.

like image 984
SolidSnake4444 Avatar asked Oct 23 '25 20:10

SolidSnake4444


1 Answers

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()
    }
}

enter image description here

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))

enter image description here

like image 111
Joe Muller Avatar answered Oct 26 '25 06:10

Joe Muller



Donate For Us

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