summaryrefslogtreecommitdiff
path: root/tex/context/base/colo-ini.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-12-24 20:08:00 +0100
committerHans Hagen <pragma@wxs.nl>2012-12-24 20:08:00 +0100
commit5f48570bba149ac17f45c80d5ee95306aa69d0c9 (patch)
treebfd405cdf69acd82e4352f142f3b0220abde6ed5 /tex/context/base/colo-ini.lua
parentd2d2f5a76a2323d1adafe3dc1926e95064b206d9 (diff)
downloadcontext-5f48570bba149ac17f45c80d5ee95306aa69d0c9.tar.gz
beta 2012.12.24 20:08
Diffstat (limited to 'tex/context/base/colo-ini.lua')
-rw-r--r--tex/context/base/colo-ini.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/tex/context/base/colo-ini.lua b/tex/context/base/colo-ini.lua
index 4fdbf4545..1a994b567 100644
--- a/tex/context/base/colo-ini.lua
+++ b/tex/context/base/colo-ini.lua
@@ -38,6 +38,8 @@ local attributes_list = attributes.list
local colorvalues = colors.values
local transparencyvalues = transparencies.values
+local texattribute = tex.attribute
+
colors.sets = colors.sets or { } -- sets are mostly used for
local colorsets = colors.sets -- showing lists of defined
local colorset = { } -- colors
@@ -503,12 +505,17 @@ local function mpcolor(model,ca,ta,default)
end
end
+local function mpnamedcolor(name)
+ return mpcolor(texattribute[a_colorspace],l_color[name] or l_color.black)
+end
+
local function mpoptions(model,ca,ta,default) -- will move to mlib-col
return format("withcolor %s",mpcolor(model,ca,ta,default))
end
-colors.mpcolor = mpcolor
-colors.mpoptions = mpoptions
+colors.mpcolor = mpcolor
+colors.mpnamedcolor = mpnamedcolor
+colors.mpoptions = mpoptions
function colors.formatcolor(ca,separator)
local cv = colorvalues[ca]