Why Do We have a Rainbow Flag?

Why do we have a rainbow flag 101:

The rainbow flag, sometimes LGBT pride flag or gay pride flag, is a
symbol of lesbian, gay, bisexual, and transgender (LGBT) pride and LGBT
social movements in use since the 1970s. The colors reflect the
diversity of the LGBT community, and the flag is often used as a symbol
of gay pride in LGBT rights marches. It originated in California, but
is now used worldwide.

Designed by San Francisco artist Gilbert
Baker in 1978, the design has undergone several revisions to first
remove then re-add colors due to widely available fabrics. Originally
there were 8 colors.

As of 2008, the most common variant
consists of six stripes, with the colors red, orange, yellow, green,
blue, and violet. The flag is commonly flown horizontally, with the red
stripe on top, as it would be in a natural rainbow. – Today eight colors can be manufactured – but people seem to have embraced the six colors. 

The original gay-pride flag flew in the San Francisco Gay Freedom Day Parade on June 25, 1978. It has been suggested that Baker was inspired by Judy Garland’s singing “Over the Rainbow” and the Stonewall riots that happened a few days after her death.