[NTG-context] Shading to transparent using withshademethod

Marco Patzer lists at homerow.info
Thu Jan 28 14:02:46 CET 2016


On Thu, 28 Jan 2016 12:29:46 +0100
Hans Hagen <pragma at wxs.nl> wrote:

> >> How to make transparent shadings work with the new mechanism?  
> >
> >        withtransparency (1,.5)  
> 
> next beta
> 
> \definecolor [trans] [a=multiply, t=.5, g=.5]
> 
> \startMPpage
>      fill fullcircle scaled 12cm withcolor \MPcoloronly{trans};
>      fill fullcircle scaled 10cm withcolor \MPcolor{trans};
> 
>      fill fullsquare xyscaled (15cm, 15cm)
>        withshademethod "linear"
>        withshadevector (0,1)
>        withshadecolors (red,\MPcoloronly{trans})
>        withtransparency \MPtransparency{trans}
>      ;
> 
> \stopMPpage

I believe the \MPcoloronly and \MPtransparency macros split up the
\MPcolor in it's colour and transparency parts.

This doesn't really provide a solution to the initial problem as I
understand. Rather it seems to be a more robust way to use
transparency and prevent choking on colours that might contain
transparent parts.

I will shade to the background colour then, which is not that clean
but works as well. Anyway, thanks for the quick answer and the
clarification.

Marco


More information about the ntg-context mailing list