The "Battle of Magenta" was fought between the crown land of the Austrian Empire, and Italian nationalists, in the 1859 near the town of Magenta, during the 2nd Italian War of Independence.
Though intitally the dye was named as Fuchsine, a name derived from the flower Fuchsia(which was in turn, named after the botanist Leonhart Fuchs), it was later renamed as Magenta in memory of the battle.
According to another legend, the battefield had turned so red after the deadly war, hence the name for the red dye.