You should see a doctor, preferably an Internist doctor. If the nail is the only thing wrong, I personally would just watch it and see if it changes back. But if the toe itself starts changing in any way, definitely see a doctor as soon as possible. You could maybe have a vascular problem??
One time when I was taking a x-ray (I was a x-ray technician) a 14” by 17” film cassette fell on my big toe. It was metal and it struck me with the corner. My nail swelled up and filled underneath with blood. I don’t remember if it was black, but it did change color. I was in pain. The dumb ER doctor shoved a needle under my nail like Chinese torture. It hurt like hell! I went home and took a paperclip and heated the end over a flame till it was red hot. Then I carefully and slowly pressed the end into the top of the nail. It melts the nail and slowly goes downward. When I had pushed a hole through the nail, a stream of blood shot up about four feet. I kid you not. It hurt like hell because there was a lot of pressure. Anyway, hope I helped some.