rest assured your swelling turning to black color is just part of the entire inflammatory response to your
injury. what you have my friend is ecchymosis
here is how it happened to you :)
for your question what is the reason:
after you injured your left foot , structures underneath your skin gets damaged (bone ligament fat small blood vessels)
they bleed tempoarily , but since you dont have a break in your skin (external cuts, open wound) the blood is trapped underneath your skin.
even if you did not ask i would like to tell you this as well, cause you probably would like to know this and save u some time of asking another question:
overtime this blood would slowly be reaborbed by your body but some of them will find their way to your skin hence giving the appearance of black or darkening of the injured body part. they temporarily "stain" your skin. but through time they will also gets reabsorbed by your body.
itll go away on its own so relax.
merry christmas in advance
Dr.Charles