On 1/28/2016 3:34 PM, Marco Patzer wrote:
On Thu, 28 Jan 2016 14:45:13 +0100
Hans Hagen <pra...@wxs.nl> wrote:

On 1/28/2016 1:53 PM, Marco Patzer wrote:
On Thu, 28 Jan 2016 12:33:39 +0100
Hans Hagen <pra...@wxs.nl> wrote:

How to make transparent shadings work with the new mechanism?

          withtransparency (1,.5)

However, this makes the entire shade transparent. How to shade
from one colour to transparent using withtransparency to achieve
an effect like in the example below?

that isn't how shading works,

…any longer. I just confirmed that it used to work on an older
installation. Just sayin'

are you sure?

See the attached example. The shade seems to go from black to fully
transparent. So regardless of the background colour the shade looks
fine. I can't replicate this with the new mechanism.

a matter of choosing the colors

\unprotect

\def\MPcoloronly#1%
  {\clf_mpcolor
     \attribute\colormodelattribute
     \colo_helpers_inherited_current_ca{#1} %
     \zerocount}

\def\MPtransparency#1%
  {\clf_mpcolor
     \zerocount
     \zerocount
     \colo_helpers_inherited_current_ta{#1} }

\protect

\startbuffer
  \definecolor[tex:bg][s=.85]
  \definecolor[mp:fg] [s=.85,t=1,a=1]
  \setupbackgrounds [page] [background=color,backgroundcolor=tex:bg]
  \starttext
    \contextversion\crlf
    \startMPcode
   % lightgray = 0.85white;
     fill fullsquare xyscaled (12cm, 12cm)
       withshademethod "linear"
       withshadevector (-1,0)
     % withshadecolors (black,lightgray)
     % withtransparency (1,1)
       withshadecolors (black,\MPcoloronly{mp:fg})
       withtransparency \MPtransparencyonly{mp:fg}
     ;
    \stopMPcode
  \stoptext
\stopbuffer

\starttext
  \typebuffer\getbuffer
\stoptext



-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to