androidandroid-jetpack-composematerial-you

Background color of the android system settings app


The Android settings use the dynamic system colors. How can I access whatever color they use as background color in my compose app? The color does not seem to be in the dynamic color scheme of compose. E.g. when using dark theme it is slightly brighter than the background and surface colors.

I am looking for the dynamic background color that can be found in the system settings app: https://i.sstatic.net/0bzA6nLC.png

I have found system_surface_dim_dark in the settings source this does not seem to be the desired color when using it with val color = colorResource(id = android.R.color.system_surface_dim_dark)


Solution

  • The color seems to be ?androidprv:attr/materialColorSurfaceBright which is a private system color.

    But I just found out that the color is equivalent to MaterialTheme.colorScheme.surfaceContainer of androidx.compose.material3.MaterialTheme.