I am looking for a way to assign numerical values to colors (then interpolate a color scale) and then assign numerical values to comparative colors

Hello may name is Chris

I am completely new to programming (but I love it!! I am learning Swift).

I am currently looking for a solution to the mentioned problem. I’m not sure if it is a ML task or if it is better to do it in the traditional way – maybe by comparing and interpolating RGB values. How I imagine that might be easier to understand in the video.

VIDEO (is there a better way to provide a video?)

The color values ​​below were taken before the adjustment and assigned to the assigned values ​​0, 2, 5, 10, 25, 50 and 100. The round section is taken from a photo (by light and shadow you can see that not every color value brings a perfect match. But that shouldn’t be a problem (I hope so) by comparing the pixels and evaluating the color value with the most matching colour at the end). My spontaneous manual evaluation gives a value that should be around 19-20.

I have already thought back and forth whether it is possible to do the whole thing using color values ​​(e.g. R G and B) but that is not so easy since there should also be many different results depending on the color format I am working with.

On the other hand, I don’t know how to solve it using ML. It would be easy to recognize the exact color values ​​0, 2, 5, 10, 25, 50 and 100 – but how can I have intermediate values ​​determined? What do you think? Which approach is the better one? If you have a tip for me, that I know in which direction I have to think further would be great! And if you have an idea how I can work on my problem I would be so grateful!!! … otherwise I think I will need the coming days to find some solution.

Thank you in advance! Chris