From 24f6f7de245bdff10f21984a9a3c6af3d31fa1f1 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 11 Oct 2019 16:46:49 +0200 Subject: 2019-10-11 15:56:00 --- tex/context/base/mkiv/mlib-lua.lua | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'tex/context/base/mkiv/mlib-lua.lua') 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 -- cgit v1.2.3