Access dark color has a variable

Dark mode is cool and would actually love to use a hover logic light/dark.
Example, var(—action-color) is set for red (Light) and brown (Dark).
How could I set a button on hover and switch getting the color of the opposite?
Dark mode off: Button is red and on-hover becomes brown.
Dark mode on: Button is brown and on-hover becomes red.