This is already done in the material package. The high-level idea is that you have a composition local that provides semantically named colors to the whole tree, and that composition local is initialized with the mapping of those semantic names to the actual ARGB values - based on the user / system preference for light, dark or dynamic (on Android S+) colors.