summaryrefslogtreecommitdiff
path: root/libs/cairo-1.16.0/util/cairo-script/examples/infinichess.cs
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-10-12 12:03:23 -0500
committersanine <sanine.not@pm.me>2022-10-12 12:03:23 -0500
commit530ffd0b7d3c39757b20f00716e486b5caf89aff (patch)
tree76b35fdf57317038acf6b828871f6ae25fce2ebe /libs/cairo-1.16.0/util/cairo-script/examples/infinichess.cs
parent3dbe9332e47c143a237db12440f134caebd1cfbe (diff)
add cairo
Diffstat (limited to 'libs/cairo-1.16.0/util/cairo-script/examples/infinichess.cs')
-rw-r--r--libs/cairo-1.16.0/util/cairo-script/examples/infinichess.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/libs/cairo-1.16.0/util/cairo-script/examples/infinichess.cs b/libs/cairo-1.16.0/util/cairo-script/examples/infinichess.cs
new file mode 100644
index 0000000..f82b102
--- /dev/null
+++ b/libs/cairo-1.16.0/util/cairo-script/examples/infinichess.cs
@@ -0,0 +1,29 @@
+/xdef { exch def } def
+/-rot { 3 1 roll } def
+/rot { 3 -1 roll } def
+/2dup { 2 copy } def
+
+/SIZE 600. def
+<< /width SIZE /height SIZE >> surface context
+1 1 1 set-source-rgb paint
+0 0 0 set-source-rgb
+EVEN_ODD set-fill-rule
+SIZE SIZE scale
+
+0.5 0 translate
+
+save
+1 1 scale
+/n 90 def
+n neg 1 n {
+ /x xdef
+ 0 0 m
+ x 1 l
+ x 0.5 add 1 l
+ 0 0 l
+} for
+restore
+fill
+
+/target get (out.png) write-to-png pop
+pop