There are a couple common processes.

Anodizing can be done at home safely with some surplus equipment bought cheaply. Varying the voltage through a salt bath will produce a whole rainbow of coloration. It will wear off over time because it's a simple surface oxide. However, if the piece is built to take apart, you can re-anodize at any time to bring back the color.

Plating with some of the hard nitriding compounds is very wear resistant, hence the point of it's use, but it is not a simple home setup.