def ModularColor(L): n = len(L) board = Graphics()
for i in range(2*n):
for j in range(2*n):
k = (i+j)%n
color = L[k]
corners=[(j,i), (j+1,i), (j+1,i+1), (j,i+1)]
chessboard=polygon2d(corners, axes=false, color=color,)
board+=chessboard
return board
KULAYS=['dodgerblue', 'mediumseagreen', 'gold', 'orangered'] ModularColor(KULAYS)