Peripheral drift illusion: Difference between revisions
docs
m (julia example) |
(docs) |
||
Line 11:
=={{header|Julia}}==
Line color tables taken from the Wren example.
<lang
function CodepenApp()
# left-top, top-right, right-bottom, bottom-left
LT, TR, RB, BL = 1, 2, 3, 4
edges = [
Line 35:
[B, W, W, B],
[B, B, W, W]]
win = GtkWindow("Peripheral drift illusion", 230, 230) |> (can = GtkCanvas())▼
▲ win = GtkWindow("Peripheral drift illusion", 230, 230)
@guarded draw(can) do widget
ctx = Gtk.getgc(can)
Line 52 ⟶ 47:
rectangle(ctx, 0, 0, 250, 250)
fill(ctx)
for x in 1:12
px = 18 + x * 14
Line 60 ⟶ 56:
fill(ctx)
carray = colors[edges[y][x]]
▲ set_line_width(ctx, 2)
line(px, py, px + 9, py, carray[1])
line(px + 9, py, px + 9, py + 9, carray[2])
Line 79 ⟶ 74:
CodepenApp()
</lang>
=={{header|Phix}}==
|