I wanted to be able to control the saturation of colors (to create some

I wanted to be able to control the saturation of colors (to create some tints) from a color palette. Modifying the brightness was already implemented.

I’ve found in some forum (which seems offline now) a while ago how to desaturate rgb with lerp.

I tried to optimize it by using the functions in lib8tion, but there might be faster options.

The code on gist:

I put some questions in the comments. Hope @Mark_Kriegsman can take a look at it.

I didn’t took luminance in account, which might improve the effect (however in hsv luminance factors don’t seem to be used as well). Any ideas on that are welcome. I don’t have a clue how to implement those factors within fixed point math.

I’ve now implemented in my local Fastled copy, but it might be interesting to add it to colorutils?

Looks cool! I’ll take a bigger look at it tonight.

Ok, it might become faster by using dim_raw and qadd8. I’ve found a clear real world explanation on video scaling over here:
https://plus.google.com/112889495015752015404/posts/UGXWJtFvz61

I need to test if it looks the same though.

A related question. I couldn’t find the APPLY_DIMMING() dimming function that you refer to in the hsv2rgb code. Doing a search it doesn’t pop up in other parts of the FastLED code.

Which of the dimming functions is used in the hsv2rgb code? Or isn’t it used at that point anymore?

I believe that it’s no longer used in that way; just leftover code to clean up. I think.