diff options
Diffstat (limited to 'tex/context/base/mkiv/colo-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/colo-ini.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/colo-ini.lua b/tex/context/base/mkiv/colo-ini.lua index 1213a637f..31db0a691 100644 --- a/tex/context/base/mkiv/colo-ini.lua +++ b/tex/context/base/mkiv/colo-ini.lua @@ -1251,3 +1251,12 @@ end -- inspect(attributes.colors.spec("red")) -- inspect(attributes.colors.spec("red socks")) + +implement { + name = "negatedcolorcomponent", + arguments = "string", + actions = function(s) + s = 1 - (tonumber(s) or 0) + context((s < 0 and 0) or (s > 1 and 1) or s) + end +} |