I was working on a game with a bunch of hexagonal tiles. I made them all have slight color variations and accidentally made an optical illusion. If you look at it without focus, you can see all of the color variations. However, if you focus on it, it looks solid-color.
Code (python w/ turtle)
This draws one of the hexagons. The forum breaks the indentation. Everything after a “def” needs to be single-indented. The line after the “for” needs to be double-indented
import turtle
from random import randint as random
def draw_line(line, x, y):
scale = min(turtle.window_width(), turtle.window_height()) / 200
turtle.goto((line[0] + x) * scale, (line[1] + y) * scale)
turtle.down()
turtle.goto((line[2] + x) * scale, (line[3] + y) * scale)
turtle.up()
def draw_hexagon(x, y, tile):
lines = ((0, 0, 0, -9.25),
(0, -9.25, -8.01, -13.88),
(-8.01, -13.88, -16.02, -9.25),
(-16.02, -9.25, -16.02, 0),
(-16.02, 0, -8.01, 4.62),
(-8.01, 4.62, 0, 0))
turtle.fillcolor((random(250, 255), random(240, 245), random(230, 235)))
turtle.begin_fill()
for line in lines:
draw_line(line, x, y)
turtle.end_fill()
i see it