Could we help you? Please click the banners. We are young and desperately need the money
Using the new color() CSS function, you can modify a given colour (even from a CSS variable).
Color() is Baseline since May 2023.
Here's an example using color() to change a colour's (#a24a9d) opacity to 50%:
color(from #a24a9d srgb r g b / 50%)
As mentioned, you can also use CSS variables:
color(from var(--some-color) srgb r g b / 50%)