I have a base color with an alpha channel. I need to create two separate colors based on this color, so when I mix them together I get the initial color (for example, when I fill the screen with the first color and then the second, I get the initial color).
So far I was being able to calculate just a 50% color. Apparently, taking the alpha channel and dividing it by whatever ratio doesn't work. I came up with the formula for getting a 50% alpha: 1 - sqrt(1 - alpha)
(based on this article on Wikipedia https://en.wikipedia.org/wiki/Alpha_compositing). It does work, but I also need to get a 10% alpha or any other percent. I know, there must be a way to calculate it.