'Algorithm to desaturate RGB color

I have a question. Is there some way or some algorithm that I can use to desaturate an RGB value without converting the color to HSV or HSL? My RGB input is going to be fully saturated, therefore I just need a way to desaturate my color.

I'm working on a color picker and I need a fast and efficient way of doing this. Any suggestions would be much appreciated:)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source