It's probably the dried up blood stuck under your nails. This happened to me (not as bad as yours) when I hit my long toe while getting out of the shower. It bled quite a bit and the top half of my long toe stayed darken because of the blood underneath. It took a couple of months before I was able to clip the nail and along with the dried blood that was stuck. Although, yours look way worse than what happened to me. I always suggest people to see doctors even if it seems like a tiny thing though. You never know.
PS, re-read my reply and it sounds grosser than it actually is.