Can anyone help me understand why constructing a `...
# compose-desktop
r
Can anyone help me understand why constructing a
MaterialTheme
object like this
Copy code
MaterialTheme(colors = darkColors()) {
    Text("Hello, world!")
}
doesn't change anything? The surface color should be
0xFF121212
(dark grey) and the text white, but my app still opens with a white surface color and black text which is the default light theme color.
Seems like it's straightforward to change the theme, so I'm not sure what I'm missing here.
b
You're missing a Surface
a
As @Big Chungus said, you need a surface that will read
MaterialTheme.colors.background
The window by default does not apply any kind of theming.
r
Oh that's interesting and a good lead. I'll follow that and hopefully sort it out. Thank you both!