As people across the world marched in Gay Pride parades this weekend – including during Canada’s largest celebration in downtown Toronto -- many came toting a brightly coloured flag of support.

The Rainbow Flag has been splashed across newspapers, TV screens and social media feeds this week, after the U.S. Supreme Court declared same-sex marriage legal in all 50 states.

There is a rich history to how the flag came to represent the LGBTQ community.

Here are four things about the Pride Flag you may not know:

It was created to be a community symbol

The concept for a flag that could represent the LGBTQ community came to the flag’s designer Gilbert Baker in 1976. Living in San Francisco at the time, he said he was continuously seeing American flags stuck on everything from paintings to jeans.

In an interview at the Museum of Modern Art (MoMA), which recently acquired the original artwork for the flag, Baker said he realized a flag is more than just a country's logo.

"(The Rainbow Flag) doesn't say the word 'gay,' and it doesn't say 'the United States' on the American Flag, but everyone knows visually what they mean," Baker told MoMA. "And flags are about proclaiming power, so it's very appropriate."

Gilbert Baker designer of Rainbow Flag

Artist Gilbert Baker, designer of the Rainbow Flag, is draped with the flag on March 17, 2014 in New York. (AP / Mark Lennihan)

It was intended to replace a mark of hatred

Before the flag's invention, a pink triangle was used by the Nazis as a symbol of homosexuality. The Nazis would post the pink triangle on people they knew or thought to be gay, said Richard Plant in his book "The Pink Triangle: The Nazi War Against Homosexuals."

The symbol was used to mark homosexuals in a similar way to how the Nazis marked Jewish people with the Star of David. Many ended up in concentration camps, Plant says.

"(The pink triangle) came from such a horrible place of murder and Holocaust and Hitler. We needed something beautiful, something from us," Baker told MoMA. "The rainbow is so perfect because it really fits our diversity in terms of race, gender, ages. All of those things."

It originally had eight stripes

Baker was also inspired by the five-striped "Flag of Races," which featured the colours red, black, brown, yellow and white.

He made the flag by hand, and dyed the eight-striped icon at a gay community centre in San Francisco.

The flag was debuted at the UN Plaza on June 25, 1978 for the Gay and Lesbian Freedom Day March in San Francisco.

Two colours -- pink for sexuality and turquoise for art – were both removed once the flag started gaining in popularity. Reports suggest hot pink was dropped because fabric in that colour wasn’t readily available, while turquoise was dropped to allow for an even number of stripes.  

Each stripe has a meaning

The rainbow wasn’t chosen only for its representation of diversity. Each colour on the flag also has a meaning. Hover over the dots on the image below to find out what each colour represents: