I am using python 2.7 to make a simple game and whenever I try to draw a rectangle I get this:
Traceback (most recent call last): File "C:/Users/HP/Desktop/experiment.py", line 335, in (WIDTH ,HEIGHT)]) TypeError: invalid color argument
Here's the relevant code
BLACK = (0, 0, 0)
grid = []
for row in range(10):
#add empty array
grid.append([])
for column in range(11):
grid[row].append(BLACK)
WIDTH = 30
HEIGHT = 30
MARGIN = 5
#starting pygame
pygame.init()
#Setting window dimensions
WINDOW_SIZE = [425,320]
screen = pygame.display.set_mode(WINDOW_SIZE)
stopped = False
while not stopped:
for event in pygame.event.get():
if event.type == pygame.QUIT:
stopped = True
#draw grid
for row in range(10):
for column in range(11):
Color = grid[row][column]
pygame.draw.rect(screen,Color,
[((MARGIN + WIDTH) * column + MARGIN, (MARGIN + HEIGHT) * row + MARGIN),
(WIDTH ,HEIGHT)])
clock.tick(60)
pygame.display.flip()
pygame.quit()
Any assistance whatsoever would be greatly appreciated!! Thanks in advance!
EDIT: If needs be here's the entire script in pastebin https://pastebin.com/jCXT0M4a
Pardon the quality of it