summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/attr-col.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-07-27 17:53:52 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-07-27 17:53:52 +0200
commitab56ea38d2f4f5b521ef097bac92812f6070ef55 (patch)
treee5f2ba9e66f1b1ef8f7b32f91aed0d744a14a0da /tex/context/base/mkiv/attr-col.lua
parentf7bfb1deb04d4ad101dbabf4d635d33cd98aa0a1 (diff)
downloadcontext-ab56ea38d2f4f5b521ef097bac92812f6070ef55.tar.gz
2017-07-27 16:23:00
Diffstat (limited to 'tex/context/base/mkiv/attr-col.lua')
-rw-r--r--tex/context/base/mkiv/attr-col.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/attr-col.lua b/tex/context/base/mkiv/attr-col.lua
index c3b644bda..48f2f2ac6 100644
--- a/tex/context/base/mkiv/attr-col.lua
+++ b/tex/context/base/mkiv/attr-col.lua
@@ -60,6 +60,8 @@ local formatters = string.formatters
local interfaces = interfaces
local implement = interfaces.implement
+local texgetattribute = tex.getattribute
+
-- We can distinguish between rules and glyphs but it's not worth the trouble. A
-- first implementation did that and while it saves a bit for glyphs and rules, it
-- costs more resourses for transparencies. So why bother.
@@ -448,6 +450,12 @@ function colors.forcesupport(value) -- can move to attr-div
colors.enable(value)
end
+function colors.toattributes(name)
+ local mc = list[a_color][name]
+ local mm = texgetattribute(a_selector)
+ return (mm == unsetvalue and 1) or mm or 1, mc or list[a_color][1] or unsetvalue
+end
+
-- transparencies
local a_transparency = attributes.private('transparency')
@@ -554,6 +562,10 @@ function transparencies.forcesupport(value) -- can move to attr-div
transparencies.enable(value)
end
+function transparencies.toattribute(name)
+ return list[a_transparency][name] or unsetvalue
+end
+
--- colorintents: overprint / knockout
attributes.colorintents = attributes.colorintents or { }