A bruise forms when the blood vessels under your skin have become damaged. Blood leaks from these vessels, and gets trapped under the skin. The dark spot you see is an accumulation of this pooled blood.
Everyone knows that blood is red and that the deoxygenated blood in your veins is somewhat blueish. If blood is either red or blueish, depending on the presence of oxygen, why are bruises sometimes black, yellow, brown, or even green?
The answer has to do with what happens to the blood after it has pooled under the skin.
Blood gets its red color from the chemical hemoglobin, which is found in abundance in every red blood cell. Hemoglobin is a complicated molecule. Unchecked, it's likely to break down into a variety of other, less complicated chemicals. Trapped in a bruise, the hemoglobin does exactly this. The trick is, while hemoglobin is a bright red, the chemicals it breaks down into come in a rainbow of colors.
Bruises tend to start out crimson or violet, and then turn brownish or yellow before they finally fade away. This is caused by the yellow-brown chemical bilirubin. In fact, because bilirubin takes a while to form in a bruise, pathologists know that any yellow bruise must be at least eighteen hours old.
As for those green brusies, that's the work of a another chemical caled biliverdin.