I would do something like this:
1. You have the "target color" (full brightness and saturation) and the amount you want to blend (between 0 and 1)
2. For each Pixel do:
2.1: multiply the target color with the brightness of the image pixel
2.2: mix the image pixel and the result from 2.1 together, according to the amount.
(1-x) * image_pixel + x * (color * image_pixel_brightness)
The Brigness of a pixel is calculated by adding up all the components and dividung the result by 3. However, there is an advanced formula that weights the colors differently.