summaryrefslogtreecommitdiff
path: root/tex/context/base/colo-run.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-12-31 14:40:26 +0200
committerMarius <mariausol@gmail.com>2011-12-31 14:40:26 +0200
commit11dde3f4c6c0584ff20070edc1b1aad0b9013d30 (patch)
treeaa8df33f2319e97b9d1634f042504433110941fb /tex/context/base/colo-run.lua
parent90cec652f5ae1daee6d4c252c5caa6a39ad719fc (diff)
downloadcontext-11dde3f4c6c0584ff20070edc1b1aad0b9013d30.tar.gz
beta 2011.12.31 13:16
Diffstat (limited to 'tex/context/base/colo-run.lua')
-rw-r--r--tex/context/base/colo-run.lua66
1 files changed, 66 insertions, 0 deletions
diff --git a/tex/context/base/colo-run.lua b/tex/context/base/colo-run.lua
new file mode 100644
index 000000000..4f1916d5a
--- /dev/null
+++ b/tex/context/base/colo-run.lua
@@ -0,0 +1,66 @@
+if not modules then modules = { } end modules ['colo-run'] = {
+ version = 1.000,
+ comment = "companion to colo-run.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- For historic reasons the core has a couple of tracing
+-- features. Nowadays these would end up in modules.
+
+local colors= attributes.colors
+
+function commands.showcolorset(name)
+ local set = colors.setlist(name)
+ context.starttabulate { "|l|l|l|l|l|l|l|" }
+ for i=1,#set do
+ local s = set[i]
+ local r = { width = "4em", height = "max", depth = "max", color = s }
+ context.NC()
+ context.setcolormodel { "gray" }
+ context.blackrule(r)
+ context.NC()
+ context.blackrule(r)
+ context.NC()
+ context.grayvalue(s)
+ context.NC()
+ context.colorvalue(s)
+ context.NC()
+ context(s)
+ context.NC()
+ context.NR()
+ end
+ context.stoptabulate()
+end
+
+function commands.showcolorcomponents(list)
+ local set = utilities.parsers.settings_to_array(list)
+ context.starttabulate { "|lT|lT|lT|lT|" }
+ context.NC()
+ context("color")
+ context.NC()
+ context("name")
+ context.NC()
+ context("transparency")
+ context.NC()
+ context("specification ")
+ context.NC()
+ context.NR()
+ context.TB()
+ for i=1,#set do
+ local s = set[i]
+ context.NC()
+ context.showcolorbar { s }
+ context.NC()
+ context(s)
+ context.NC()
+ context.transparencycomponents(s)
+ context.NC()
+ context.colorcomponents(s)
+ context.NC()
+ context.NR()
+ end
+ context.stoptabulate()
+end
+