import pygame as pg, random
pg.init()
pg.display.set_caption("Pozadine")
(sirina, visina) = (300, 300)
prozor = pg.display.set_mode((sirina, visina))

def nasumicna_boja():
    r = random.randint(0,255)
    g = random.randint(0,255)
    b = random.randint(0,255)
    BOJA = (r, g, b)
    return BOJA

for i in range(10):
    # bojimo pozadinu prozora
    prozor.fill(nasumicna_boja())
    pg.display.update()	#osvežava prikaz prozora
    pg.time.wait(3000)
    
pg.display.update()#osvežava prikaz prozora
while pg.event.wait().type != pg.QUIT:
    pass
pg.quit()






