diff options
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) |