The kofia is a brimless cylindrical cap with a flat crown, worn by men in East Africa, especially Swahili-speaking cultures. Kofia is a Swahili word that means hat.  The kofia is worn with a dashiki, a colorful African shirt which is called a kitenge shirt in some regions of East Africa. In Kenya, Muslims of all tribes wear the kofia with a kanzu, a white robe with a tassel.  Recently, many Christians in Kenya have started to wear the kanzu as well. In Uganda, the kofia is worn with the kanzu on informal occasions.
The traditional kofia has tiny pin holes in the cloth that allows the air to circulate.
In Zanzibar, and Northern Uganda, the Bargashia is a popular hat. This hat was named after Barghash bin Said of Zanzibar, the former Sultan of Zanzibar. Unlike the kofia, it is covered in embroidery and does not have pin holes. Like the kofia, the bargashia is worn with the kanzu. 
The fez is also worn with the kanzu and dashiki in East Africa. The East African style has a tassel that hangs from the top of the hat. The red fez was introduced into the region by the military. During British colonial rule of East Africa, the red fez was worn by a regiment called the King's African Rifles. The fez is also worn in West Africa, but the West African version has a stem on top of the hat, and no tassel.