Re: [NTG-context] Define color with calculations

2019-02-18 Thread Henri Menke
On 19/02/19 10:33 AM, Wolfgang Schuster wrote: > Mohammad Hossein Bateni schrieb am 18.02.19 um 04:37: >> Hi, >> >> When I use definecolor, (how) can I use computations in setting the >> value of a component?  Something like the following... >> >> \definecolor[mycolor][r=0.5*0.7] > > \starttext >

Re: [NTG-context] Define color with calculations

2019-02-18 Thread Wolfgang Schuster
Mohammad Hossein Bateni schrieb am 18.02.19 um 04:37: Hi, When I use definecolor, (how) can I use computations in setting the value of a component?  Something like the following... \definecolor[mycolor][r=0.5*0.7] \starttext \colored[r=\cldcontext{0.5*0.7}]{\cldcontext{0.5*0.7}}

Re: [NTG-context] Define color with calculations

2019-02-18 Thread Mohammad Hossein Bateni
Thanks, Henri! Works like a charm. On Sun, Feb 17, 2019 at 11:03 PM Henri Menke wrote: > Use Lua. > > > \def\eval#1{\ctxlua{% > local context = context > local _ENV = math > context(#1) > }} > > \definecolor[mycolor][r=\eval{0.5*0.7}] > > \starttext > > \color[mycolor]{Hello!} > >

Re: [NTG-context] Define color with calculations

2019-02-17 Thread Henri Menke
Use Lua. \def\eval#1{\ctxlua{% local context = context local _ENV = math context(#1) }} \definecolor[mycolor][r=\eval{0.5*0.7}] \starttext \color[mycolor]{Hello!} \stoptext On 18/02/19 4:37 PM, Mohammad Hossein Bateni wrote: > Hi, > > When I use definecolor, (how) can I use