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 the gay pride flag and LGBT pride flag, is a symbol of lesbian, gay, bisexual, and transgender (LGBT) pride and LGBT social movements. (Other uses of rainbow flags include a symbol of peace.) The colors reflect the diversity of the LGBT community, and the flag is often used as a symbol of gay pride when it comes to LGBT rights marches. It originated in Northern California, but is now used worldwide.

Designed by San Francisco artist Gilbert Baker in 1976, the design has undergone several revisions to first remove then re-add colors due to widely available fabrics. 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.

What do you think?

Leave a Reply

%d bloggers like this: