Black is a subdued and formal color. Wearing black clothes has been a long-accepted funeral tradition in the western countries, which dates back to the Roman empire in 753 BCE. It is intended to show respect for the deceased and there is a kind of togetherness in wearing the same color clothing during the mourning to console the family members.
In many parts of India, people wear white clothes during the funeral.
Yellow is the color of mourning in Egypt, Red in Ghana and many Catholic churches follow purple color.