I am trying to create an application like the one here:
Basically lots of overlapping circles drawn with pygame. I cannot figure out how the blend the circles to make them translucent. That is to have overlapping colors show through. My code so far is this:
import sys, random, time
import pygame
from pygame.locals import *
from pygame import draw
rand = random.randint
pygame.init( )
W = 320
H = 320
size = (W, H)
screen = pygame.display.set_mode(size)
run = True
while 1:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_SPACE :
run = not run
else:
sys.exit()
if run:
xc = rand(1, W)
yc = rand(1, H)
rc = rand(1, 25)
red = rand(1, 255)
grn = rand(1, 255)
blu = rand(1, 255)
draw.circle(screen, (red, grn, blu, 200), (xc, yc), rc, 0)
pygame.display.flip()