diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-08-15 09:54:36 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-08-15 09:54:36 +0200 |
commit | 36a37da721032b8d02fad41f22ad717ee8136f34 (patch) | |
tree | 6481c1e6fca21c63679c03ad66800d505334c7b8 /tex/context/base/mkiv/attr-col.lua | |
parent | 1ef7a093aaf03b6327b3da94d47f53760c868c60 (diff) | |
download | context-36a37da721032b8d02fad41f22ad717ee8136f34.tar.gz |
2018-08-14 23:17:00
Diffstat (limited to 'tex/context/base/mkiv/attr-col.lua')
-rw-r--r-- | tex/context/base/mkiv/attr-col.lua | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/tex/context/base/mkiv/attr-col.lua b/tex/context/base/mkiv/attr-col.lua index 28e63b177..f970fb8e7 100644 --- a/tex/context/base/mkiv/attr-col.lua +++ b/tex/context/base/mkiv/attr-col.lua @@ -406,10 +406,29 @@ function colors.setmodel(name,weightgray) weightgray = true end end - colors.model = name -- global, not useful that way - colors.default = models[name] or 1 -- global - colors.weightgray = weightgray -- global - return colors.default + local default = models[name] or 1 + + colors.model = name -- global, not useful that way + colors.default = default -- global + colors.weightgray = weightgray -- global + + -- avoid selective checking is no need for it + + local forced = colors.forced + + if forced == nil then + -- unset + colors.forced = default + elseif forced == false then + -- assumed mixed + elseif forced ~= default then + -- probably mixed + colors.forced = false + else + -- stil the same + end + + return default end function colors.register(name, colorspace, ...) -- passing 9 vars is faster (but not called that often) |