Rainbow Flag

Rainbow Flag in Pygame

By Monty, 29th June 2015

Rainbow Flag

Rainbow Flag

This little Pygame program paints the Rainbow Flag, as used by the LGBT movement. It illustrates:

'''     RainbowFlag.py
        Author: Alan Richmond, Python3.codes
import pygame
cols = ['#ff0000','#ff8000','#ffff00','#008000','#0000ff','#a000c0']

w, h = 1000, 618                    # width, height
y = h/6                             # width per stripe

d = pygame.display.set_mode((w,h))
for i, c in enumerate(cols):


The rainbow flag, commonly known as the gay pride flag or LGBT pride flag, is a symbol of lesbian, gay, bisexual and transgender (LGBT) pride and LGBT social movements. Other older uses of rainbow flags include a symbol of peace. The colors reflect the diversity of the LGBT community, as the flag is often used as a symbol of gay pride during LGBT rights marches. While this use of the rainbow flag originated in Northern California’s San Francisco Bay Area, the flag is now used worldwide.

Originally devised by San Francisco artist Gilbert Baker, the design has undergone several revisions since its debut in 1978, first to remove colors then restore them based on availability of fabrics. The most common variant consists of six stripes: red, orange, yellow, green, blue, and violet. The flag is typically flown horizontally, with the red stripe on top, as it would be in a natural rainbow.

What do you think?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: