Khaki is a colour named after dirt. The word comes from Urdu khaki, "dusty," which is built on khak, the Persian word for dust or soil.

It reached English through the British army in India. The Corps of Guides was raised in December 1846 to scout and gather intelligence on the northwest frontier. Its commander, Harry Lumsden, and his subaltern William Hodson pioneered a drab field uniform that came to be known as khaki. Wikipedia dates its introduction to 1848.

There was no factory dye for it. According to the regimental history of the Queen's Royal Surreys, the Guides first coloured white cloth with a dwarf palm called mazari. It turned the cloth a drabbish grey. Leather was stained with mulberry juice, which gave a yellowish shade.

The popular story has officers dunking their whites in tea, mud and curry powder. That did happen, but later. The same history places it after the Afghan War of 1878-80. Regiments then dyed their own cloth with tea, coffee, mud and curry powder, and each corps had its own recipe.

The reason was simple. White and scarlet stand out against dusty hills, and drab does not. Lord Napier later called the Guides "the only properly dressed light troops in India."

The word first appears in English in 1857, the year of the Indian Rebellion. Many units raised in the Punjab for that fighting wore khaki. It was in use as an adjective by 1863.

From there it spread across the empire. British troops first wore khaki officially on the 1868 expedition to Abyssinia. After the Afghan War of 1878-80 it became the official service dress in India. The Sudan campaign of 1897-98 put every soldier in it, and that campaign made it standard across the British Army.

In the Second Boer War of 1899-1902, British soldiers were nicknamed "Khakis." A general election held during the war became known as the khaki election. The US Army adopted khaki in 1898, during the Spanish-American War, replacing its blue field uniforms.

The last shift came after the Second World War. Military khaki trousers made of chino twill became everyday civilian clothing. That is why "khakis" now means a pair of trousers as much as a colour. The trousers are named for the colour, and the colour is named for the dust.