diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-07-15 23:43:51 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-07-15 23:43:51 +0200 |
commit | 3eb2d078f0023266585aec42d98326d72567b9d6 (patch) | |
tree | 115ce667ddeb5c3e4a3c2ba6e14ff1869c63fbd5 /tex/context/base/mkiv/colo-ini.lua | |
parent | 1373cbe7fd26acc28c673ebee8eeab3ec120f294 (diff) | |
download | context-3eb2d078f0023266585aec42d98326d72567b9d6.tar.gz |
2016-07-15 23:35:00
Diffstat (limited to 'tex/context/base/mkiv/colo-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/colo-ini.lua | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/colo-ini.lua b/tex/context/base/mkiv/colo-ini.lua index f094259e0..1213a637f 100644 --- a/tex/context/base/mkiv/colo-ini.lua +++ b/tex/context/base/mkiv/colo-ini.lua @@ -37,6 +37,8 @@ local transparencies = attributes.transparencies local colorintents = attributes.colorintents local registrations = backends.registrations +local v_reset = interfaces.variables.reset + local texsetattribute = tex.setattribute local texgetattribute = tex.getattribute local texgetcount = tex.getcount @@ -290,8 +292,32 @@ colors.forcedmodel = forcedmodel colors.couple = true -local function definetransparency(name,n) - transparent[name] = n +local function definetransparency(name,n,global) + if n == v_reset then + definetransparent(name, 0, global) -- or attributes.unsetvalue + return + end + local a = tonumber(n) + if a then + transparent[name] = a -- 0 .. 16 + return + end + local a = transparent[name] + if a then + transparent[name] = a + return + end + local settings = settings_to_hash_strict(n) + if settings then + local a, t = settings.a, settings.t + if a and t then + definetransparent(name, transparencies.register(name,transparent[a] or tonumber(a) or 1,tonumber(t) or 1), global) + else + definetransparent(name, 0, global) + end + else + inherittransparent(name, n, global) + end end colors.definetransparency = definetransparency @@ -1090,7 +1116,13 @@ implement { implement { name = "definetransparency", actions = definetransparency, - arguments = { "string", "integer" } + arguments = { "string", "string" } +} + +implement { + name = "definetransparencyglobal", + actions = definetransparency, + arguments = { "string", "string", true } } implement { |