How to convert colors from Light Mode to Dark Mode?

I tried to convert colors in drawing from light mode to dark mode by converting color to HSV color-space and then invert the brightness value.

But it doesn't work well.
So i would like to know if there are a way that we could convert a color from light mode to dark mode and otherwise?

Thank you very much for the great framework!
How to convert colors from Light Mode to Dark Mode?
 
 
Q