summaryrefslogtreecommitdiff
path: root/tex/context/base/colo-ini.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-09-04 18:08:00 +0200
committerHans Hagen <pragma@wxs.nl>2012-09-04 18:08:00 +0200
commit425cbd3c69a5e8fc3ded0a48749205ba52641eb4 (patch)
treea584d85fa77a06e53a7d6f613a71d2d1251fdf0d /tex/context/base/colo-ini.lua
parent4e31ff5b5b5322618162608319002fc1c3ef0e0e (diff)
downloadcontext-425cbd3c69a5e8fc3ded0a48749205ba52641eb4.tar.gz
beta 2012.09.04 18:08
Diffstat (limited to 'tex/context/base/colo-ini.lua')
-rw-r--r--tex/context/base/colo-ini.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/tex/context/base/colo-ini.lua b/tex/context/base/colo-ini.lua
index 253027238..f2437cd9d 100644
--- a/tex/context/base/colo-ini.lua
+++ b/tex/context/base/colo-ini.lua
@@ -846,3 +846,21 @@ end
-- context.popcatcodes()
-- end
+-- handy
+
+local models = storage.allocate { "gray", "rgb", "cmyk", "spot" }
+
+colors.models = models -- check for usage elsewhere
+
+function attributes.colors.spec(name)
+ local t = colorvalues[attributes_list[name]] or colorvalues[attributes_list.black]
+ return {
+ model = models[t[1]],
+ s = t[2],
+ r = t[3], g = t[4], b = t[5],
+ c = t[6], m = t[7], y = t[8], k = t[9],
+ }
+end
+
+-- inspect(attributes.colors.spec("red"))
+-- inspect(attributes.colors.spec("red socks"))