When and why did the rainbow flag get associated with gay pride?

by Gunslinger1991
TibetanPeachPie

The rainbow flag, as associated with gay pride was made by Gilbert Baker in 1978. It was commissioned by the SF gay pride parade and he states the rainbow motif was to represent diversity.

Edit: I forgot to mention that the original flag had 8 colors and the present flag has 6. Here's a picture I took at SF pride on Sunday that shows the 6 color flag. It dropped the pink from the top and the turquoise from the lower middle due to printing cost and practicality concerns of display. The current flag came into place fairly soon after the original flag, basically within a year.