Changing colour gradients

A reoccurring issue, is to change the a colour in an image to another, but retaining the color gradient. For example, changing a greyscale image to green, but the light greys change to light green, the dark grays to dark green. The image is greyscale because the black drawing is anti-aliased with varying shades of grey.

Corel Paintshop Pro includes the Color Replacer, which is supposed to do just this. Either I do not understand how it works, or it does not quite do what I was expecting, and it ignores the lightest pixels, or changes all pixels to the same shade of colour.

The solution is to the use the Red/Green/Blue color affect. For black text on a white background, the trick is to invert the image first, to white on back. Then use the Red/Green/Blue color affect.

There must be an easier way!