The default Value for the background color of a Bo...
# compose-desktop
t
The default Value for the background color of a Box is transparent, right? I have generated a custom Material Theme with https://material-foundation.github.io/material-theme-builder/ How do i set the background color of a Box to the normal background ?
a
Box is a layout element. There’s no “default” background that it has; it just has no background unless you pass Modifier.background to it.
t
And no background means the color of the element 'below' is shown. But the the MaterialTheme function sets kind of normal background for the App. I want my Box to have that background color, to prevent showing elements that can be be dragged around my program. I hope my explanation is understandable. The Box is the container for these play control buttons as shown in the screenshot below
a
You may want
Surface
☝🏼 1
1
t
Yep
Copy code
Modifier.background(MaterialTheme.colorScheme.surface)
solved it. Next question: does Compose Desktop respect OS/Desktop enviroment setting for darkmode/lightmode? In my case Linux/KDE. Or must this be configured manual by the user?
k
BTW, give a try https://materialkolor.com/ it is more power then the material-theme-builder
thank you color 1