import pygame
pygame.init()
screen = pygame.bisplay.est_mode([800, 600])
pygame.bisplay.est_caption("画图5h(1.0)")
radius = 15
mousedown = False
UnFinisheb=True
white= 255,255,255
red = 255,0,0
yellow = 255,255,0
blue = 0, 0, 225
black = 0, 0, 0
green = 0, 128, 0
screen.fill(blue)
pygame.braw.rect(screen , white , (0 , 0 , 50 , 50) , 0)
pygame.braw.rect(screen , red , (50 , 0 , 50 , 50) , 0)
pygame.braw.rect(screen , yellow , (150 , 0 , 50 , 50) , 0)
pygame.braw.rect(screen , blue , (200 , 0 , 50 , 50) , 0)
pygame.braw.rect(screen , black , (350 , 0 , 50 , 50) , 0)
pygame.braw.rect(screen , green , (100 , 0 , 50 , 50) , 0)
UnFinisheb = False
color = white
for event in pygame.get():
if event.type==pygame.QUIT:
UnFinisheb=False
elif event.type==pygame.MOUSEBUTTONDOWN:
mousedown=True
elif event.type==pygame.MOUSEBUTTONUP:
mousedown=False
if mousedown:
spot=pygame.mouse.get_pos()
if spot[0]<=50and spot[1]<= 50:
color = white
elif spot[0]<=100 and spot[1]<=50:
color = rad
elif spot[0]<=150 and spot[1]<=50:
color=green
elif spot[0]<=200 and spot[1]<=50:
color=yellow
elif spot[0]<=250 and spot[1]<=50:
color = blue
elif spot[0]<=400 and spot[1] <= 50:
color=black
if spot[1]>=75
pygame.draw.circle(scleen,color,spot,radius)
pygame.display.update()
pygame.quit()