Local paint shop can mix any RAL or NCS color I choose but considering the required minimum volume I would be wasting money by throwing unused paint to trash. I have an idea of buying standard pre-mixed opaque acrylic paint colors - blue, red and yellow (RYB primary colors), white (to lighten) and black (to darken) - and I should be good to go.
I can also buy pre-mixed green, orange and violet (RYB secondary colors) to skip mixing primary colors. (There are also other pre-mixed colors like gray and brown but lets ignore them.)
I have a colorimeter and I can measure RGB values of these paint colors.
So, I have defined set of 8 paint colors with known RGB values.
My question is obvious. Is there algorithm that takes desired target RGB color as input and outputs proportional amnounts of source colors? (I believe there is, how would a printer know how to mix CMYK on white paper. OK, dealing with actual paint color is much more complicated than dealing with light mixing because of pigments and different absorbtion and reflection characteristics of paint colors, but anyway...)
Product of mixing suggested proportional amnounts does not have to be (and can´t be) a perfect match with target color, but as close as possible.
Algorithm should optimally use source colors, i.e., it will not mix blue and yellow to get green, but use available green instead.
If I remove green color from defined set, algorithm should use blue and yellow to get green, of course.
If I add already mentioned gray and brown or more colors to defined set, algorithm should use them when neccessary.
Algorithm should not overcomplicate mixing trying to use every available source color even when not neccessary. There should be option to limit number of source colors that can be used. I mean, with 8 source colors I tell algorithm to use only 3 colors and algorithm will choose the best combination to get closest to target color.
Knowing the difference (e.g., in %) between desired target color and expected mixed color would be a nice indicator to have.
Is this possible? If not, I still can manually mix as many colors I need, write down proportions, measure RGB values and create a fix color chart to have consistent results in future. Such algorithm would be great tool to get idea how to start mixing at all.