I work myself with a fully saturated RGB palette and then modify saturation to

I work myself with a fully saturated RGB palette and then modify saturation to create tints.
However I’m wondering if I do it in the best way. Because the colors turn white pretty soon.

I modify saturation like this (for all colors, I just show red channel below):

rgb.r = min( (rgb.r + saturation), 255 );

After that I modifiy brightness with:

rgb.r = scale8( rgb.r, brightness);

Then a final dim curve is added for linear appearance.

==

Here I found this method of interpolating to a greyscale image:
http://www.graficaobscura.com/matrix/index.html

In my opinion the greyscale “picture” from a fully saturated led is 255, so white.

But do I have to take those luminance vectors in account?

Anyone has ideas about how to implement saturation in the right way. Is the order right? First saturation,
then brightness, or should switch them around. Since brightness also influences the appearance from saturation.

As a related side note: During my research I came across the source below, maybe interesting because it takes the
total intensity in account. The algorithm is nice but not really optimised. The build in HSV from FastLED also takes total intensity in account as far I’m aware.

http://saikoled.com/assets/img/Color%20Spaces%20in%20LED%20Lighting.pdf

maybe there is gamma correction that is necessary for saturation? what happens when you use the dim8 and brighten8 functions instead of scale8?

I have gamma correction implemented after the scale.

Adding dim_raw on saturation make the white curve less steep in the beginning. However I’m pretty happy with the normal effect as well. I’m just always curious if things can be done better. So it was also to see of maybe other people have other practices.