diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-07-13 16:28:12 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-07-13 16:28:12 +0200 |
commit | 5a923dc5ac055164721b40a58e4d1614fc7f2aa1 (patch) | |
tree | b680cfbe5a20a623c6dd2593fd4be474d047adca /tex/context/base/mkiv/colo-ini.lua | |
parent | bf7fc74b4f42f6bc1c57488da72bbc142c47f86a (diff) | |
download | context-5a923dc5ac055164721b40a58e4d1614fc7f2aa1.tar.gz |
2016-07-13 15:15:00
Diffstat (limited to 'tex/context/base/mkiv/colo-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/colo-ini.lua | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/colo-ini.lua b/tex/context/base/mkiv/colo-ini.lua index 467ec2c47..f094259e0 100644 --- a/tex/context/base/mkiv/colo-ini.lua +++ b/tex/context/base/mkiv/colo-ini.lua @@ -477,6 +477,11 @@ end colors.isblack = isblack +-- local m, c, t = attributes.colors.namedcolorattributes(parent) +-- if c and c > 1 then -- 1 is black +-- local v = attributes.colors.values[c] + + local function definespotcolor(name,parent,str,global) if parent == "" or find(parent,"=",1,true) then colors.registerspotcolor(name, parent) -- does that work? no attr @@ -817,6 +822,10 @@ end local function spotcolorname(ca,default) local cv, v = colorvalues[ca], "unknown" + if not cv and type(ca) == "string" then + ca = resolvedname(ca) -- we could metatable colorvalues + cv = colorvalues[ca] + end if cv and cv[1] == 5 then v = cv[10] end @@ -825,6 +834,10 @@ end local function spotcolorparent(ca,default) local cv, v = colorvalues[ca], "unknown" + if not cv and type(ca) == "string" then + ca = resolvedname(ca) -- we could metatable colorvalues + cv = colorvalues[ca] + end if cv and cv[1] == 5 then v = cv[12] if v == "" then @@ -836,6 +849,10 @@ end local function spotcolorvalue(ca,default) local cv, v = colorvalues[ca], 0 + if not cv and type(ca) == "string" then + ca = resolvedname(ca) -- we could metatable colorvalues + cv = colorvalues[ca] + end if cv and cv[1] == 5 then v = cv[13] end @@ -1085,9 +1102,9 @@ implement { implement { name = "spotcolorname", actions = { spotcolorname, context }, arguments = "integer" } implement { name = "spotcolorparent", actions = { spotcolorparent, context }, arguments = "integer" } implement { name = "spotcolorvalue", actions = { spotcolorvalue, context }, arguments = "integer" } -implement { name = "colorcomponents", actions = { colorcomponents, context }, arguments = "integer" } -implement { name = "transparencycomponents", actions = { transparencycomponents, context }, arguments = "integer" } -implement { name = "processcolorcomponents", actions = { processcolorcomponents, context }, arguments = "integer" } +implement { name = "colorcomponents", actions = { colorcomponents, context }, arguments = { "integer", tokens.constant(",") } } +implement { name = "transparencycomponents", actions = { transparencycomponents, context }, arguments = { "integer", tokens.constant(",") } } +implement { name = "processcolorcomponents", actions = { processcolorcomponents, context }, arguments = { "integer", tokens.constant(",") } } implement { name = "formatcolor", actions = { formatcolor, context }, arguments = { "integer", "string" } } implement { name = "formatgray", actions = { formatgray, context }, arguments = { "integer", "string" } } @@ -1196,5 +1213,9 @@ function colors.spec(name) } end +function colors.currentnamedmodel() + return models[texgetattribute(a_colormodel)] or "gray" +end + -- inspect(attributes.colors.spec("red")) -- inspect(attributes.colors.spec("red socks")) |