I believe this could be handled either by the some MaterialColors or a lambda which returns the right color for the right provided state.
@Adam Powell mentioned that styles can animate as well, light to dark mode or state changes which is an extra we have instead of xml