Titanium is colored by applying oxygen to the metal surface, usually through a process called anodizing. There is a pretty good description of how to anodize titanium on MrTitanium’s website. There is also a page that tries to explain how oxygen makes it colorful. If there are questions or suggestions after reading those, I’d like to see them. Feedback given here may modify those pages.
Don’t confuse anodizing titanium with anodizing aluminum. The electro-chemistry is similar, but the procedure, electrolyte, voltage needed, current consumed, the time it takes, and safety hazards are different. You can anodize aluminum with a titanium anodizer, but not the other way around.
Safety issues with titanium are mostly high voltage related. The electrolytes recommended are generally safe enough to use on your garden for fertilizer or pest control: Ammonium phosphate is lawn fertilizer, and TSP is a cheap detergent that can be used to control plant parasites, and washes down to enhance root growth.