Some tools don’t get enough attention, this tool might be one of them. You could compare it somehow with the Healing Brush, although there is a difference. This tool works like a regular paint brush, it manipulates the color on your image while the underlying texture stays unaffected. Because of this, you can apply a color change in a more precision way.
If you select the tool in the Toolbox, you’ll get to see the various options in the Options bar like different Modes to work with in which the Replace Color Tool can be applied: Hue, Saturation, Color and Luminosity. The Hue will apply the replacement in the most subtle way, while the Color mode might result is a far too vibrant effect.
Sampling determines the source for the color replacement. “Continuous” means you will be continuously sampling as you go. “Background Swatch” uses the background swatch as a pre-defined sample color. Only areas containing the current background color will be replaced. “Once” will replace the targeted color only in areas containing the color that you’ve first clicked.
You also have Limits options. “Contiguous” will replace colors that are contiguous with the color immediately under the pointer “Discontinuous” will replace the sample color under the pointer wherever you go. “Find Edges” will replace connected areas containing the sampled color while preserving the sharpness of the shape edges.
The Tolerance is a bit like with other tools, the higher the percentage the broader the range and the more colors will be replaced. Check the antialiasing option to get softer edges, although it could give you a less precise result. You can use the “Find Edges” options to limit the antialiasing.
The foreground color will be used as your new color that will replace the unwanted color.
Before and after