My finger is a kind of purple colour since hitting with hammer but it only hurts when touched any ideas what is wrong?

Hemorrhage. Blood under skin. If not painful bone is probably not broken. Can use splint temporarily until resolves. Bromelain orally may speed resolution.