Magenta is a color named after a battle, and the dye behind it had two earlier names.
François-Emmanuel Verguin, director of a chemical factory near Lyon, made a reddish-purple aniline dye in late 1858 or early 1859. Wikipedia says he called it fuchsine, after the color of the fuchsia flower. He took it to the paint makers Francisque and Joseph Renard, who began producing it in 1859.
In Britain, chemists Edward Chambers Nicholson and George Maule made a nearly identical dye. They started manufacturing it in 1860 under the name roseine. The same year they renamed it magenta.
The name honors the Battle of Magenta, fought on 4 June 1859 in Lombardy. French and Sardinian forces under Napoleon III defeated the Austrian army, commanded by Marshal Ferenc Gyulay. The Austrians withdrew, and Wikipedia says the victory helped liberate Italy from Austrian control.
The dating is where the popular version slips. It is often said the dye was renamed in 1859, but Etymonline gives 1860 for the name, and Wikipedia places the rename by Nicholson and Maule in 1860. Only the discovery of the dye belongs to 1859.
One extra detail is shaky. The Wikipedia article on the battle says the color was named "apocryphally" for the blood-stained red trousers of French soldiers. That reason is a later flourish, not part of the documented naming.
What the sources agree on is the link to the town. Magenta is in Lombardy, in the Metropolitan City of Milan, and the color carries its name.