When I`m trying to force NavigationBar
to be MaterialTheme.colorScheme.surface
color(see Material 3 Guidelines), background color of app and color of NavigationBar
differs. Example: color of NavigationBar
is #f1edf7
but background color is #fffbfe
. Background app color is MaterialTheme.colorScheme.surface
too.
There is a thing named tonalElevation
in material design 3. Same "base" color is different at different tonal elevation. Surface by default has tonal elevation 0dp, which means that background color is used as is. NavigationBar
has tonal elevation 3dp, which changes the color slightly. If you want to force NavigationBar
to be exactly surface color, change its tonal elevation to 0.