The Kepi was the typical combatant head wear on both sides of the skirmish line during the American Civil War. The term was adapted from the French Colonial Expeditionary Forces hat at the end of the 19th century. The Union Army Kepi was typically a wool cap that was blue cloth side and black leather on the visor. The Confederate Army Kepi was a grey cloth and block leather.
Actual color patterns told you the uni typ. A light blue base with grey sides and grey top was a foot soldier. Put a yellow band on it and that was a cavalry soldier. A red base was a cannoniere.