A controlled oxide layer formed on the metal surface. On titanium and zirconium, the colour comes from light interference in the oxide — set by the voltage applied during the anodising process, not by dye. Different voltages produce different oxide thicknesses, which shift the interference colour from gold through bronze, purple, blue, and teal. The colour is in the metal itself, not a coating on top of it.
On aluminium, the process works differently — the porous oxide layer is dyed. That’s a different material and a different mechanism. Titanium anodising and aluminium anodising share a name and not much else.
True anodised titanium is durable. It can be scratched through, and the colour does not replenish once removed, but it holds up well to carry. Heat colour (flame colouring) is sometimes described as anodising but is a different process with different durability.