Does 5 variations of Material Surface color only happen on dynamic theme? I'm talking about Surface variation that depend on elevation.
s
Stylianos Gakis
03/16/2023, 8:24 AM
If you’re talking about Material 3, and you are talking about tonal elevation, then no it happens on material 3 as a whole, not just when using dynamic colors. Since what it does in order to calculate this color is call this function with
surfaceTint
being what you set as
surfaceTint
in your m3 colorScheme, which “mixes” with your other color.
k
K Merle
03/16/2023, 8:42 AM
Thanks, that's what I needed to know.
c
Chris Sinco [G]
03/16/2023, 11:19 PM
Indeed, you can either set tonalElevation by dp values on certain Material components like Surface, or use that function directly.