I'm looking for a way to combine a RGB color with a grayscale color.

I am looking into this for a gradient generator that uses stored colors and a template (pre-made style properties for most venders) to create a CSS3 gradient.
I am sure their is a simple solution, but I can not seem to find it. I am not looking for anyone to make me a custom function, I just need to know how to make the function.