diff options
Diffstat (limited to 'tex/context/base/mkiv/mlib-lua.lua')
-rw-r--r-- | tex/context/base/mkiv/mlib-lua.lua | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/mlib-lua.lua b/tex/context/base/mkiv/mlib-lua.lua index 5af1ccb68..666025154 100644 --- a/tex/context/base/mkiv/mlib-lua.lua +++ b/tex/context/base/mkiv/mlib-lua.lua @@ -502,7 +502,6 @@ do local function mptransform(x,y,xx,xy,yx,yy) n = n + 1 - inspect(x) if type(x) == "table" then buffer[n] = f_transform(x[1],x[2],x[3],x[4],x[5],x[6]) else @@ -510,6 +509,28 @@ do end end + local function mpcolor(c,m,y,k) + n = n + 1 + if type(c) == "table" then + local l = #c + if l == 4 then + buffer[n] = f_quadruple(c[1],c[2],c[3],c[4]) + elseif l == 3 then + buffer[n] = f_triplet(c[1],c[2],c[3]) + else + buffer[n] = f_numeric(c[1]) + end + else + if k then + buffer[n] = f_quadruple(c,m,y,k) + elseif y then + buffer[n] = f_triplet(c,m,y) + else + buffer[n] = f_numeric(c) + end + end + end + -- we have three kind of connectors: -- -- .. ... -- (true) @@ -658,6 +679,7 @@ do aux.fprint = mpfprint aux.quoted = mpquoted aux.transform = mptransform + aux.color = mpcolor -- for the moment |