[NTG-context] Shading and transparency

Marco Patzer lists at homerow.info
Thu Jul 12 23:53:32 CEST 2018


On Thu, 12 Jul 2018 22:59:05 +0200
Hans Hagen <j.hagen at xs4all.nl> wrote:

> hm, I'm puzzled as a shade doesn't go between colors + transparent
> but from one color to another (in the same color space) and
> transparency is just a different mechanism
> 
> maybe it was some side effect of chosen values / vectors that gave
> the combined impression (which is why i want to see the pdf made by
> context that you use as reference)

I just checked some older projects and the older versions. I used a
mix between

- linear_shade…
- withshading("linear"…
- withshademethod "linear" …

depending on the age of the project. And I fail to find a project
using transparent shading where the transparency is done in context.
I could not get it working now on the older versions. Maybe you're
right and it has never worked the way I thought it had. Sorry for
the noise.

> \setupbackgrounds [page] [background=color, backgroundcolor=lightgray]
> 
> \starttext
> 
> \startuseMPgraphic{test}
>      graycolor white; white := 1 ;
>      fill OverlayBox
>          withshademethod "linear"
>          withshadedirection shadedup
>          withshadefactor 1.5
>          withshadecolors (.85white,white)
>        % withtransparency (multiplytransparent,.7)
>          withtransparency (normaltransparent,.7)
> \stopuseMPgraphic
> 
> \defineoverlay[test][\useMPgraphic{test}]
> 
> \framed
>    [align=middle,background={foreground,test}]
>    {\samplefile{sapolsky}}
> 
> \stoptext

That's basically shading to the background colour, which gives the
impression of transparency. I've been using that. Works most of the
time. But it's not the same. See the attached file and compare.

I guess I'll keep using the external file overlay then.

> > Just run the first example with an old context version. The file
> > gradient-t from my last mail was created using inkscape as I don't
> > want a single project to depend on two different context versions.  
> you're kidding ... i have no old context on my machine

Silly me :)

Marco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0nC.pdf
Type: application/pdf
Size: 11557 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20180712/1c0e08e3/attachment-0001.pdf>


More information about the ntg-context mailing list