import pygame
import random
pygame.init()
win = pygame.display.set_mode((256,256))
pygame.display.set_caption("")
run = True
while run:
pygame.time.delay(100)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
pygame.image.save(win, "image.jpg")
win.fill((0,0,0))
for i in range(0,256):
for z in range(0,256):
r = random.randint(0,255)
g = i%255
b = z%255
pygame.draw.line(win, (r,g,b), (i,z), (i,z))
pygame.display.update()
pygame.quit()
|