diff options
author | Karl Berry <karl@freefriends.org> | 2021-12-25 21:42:37 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-12-25 21:42:37 +0000 |
commit | d2f833a4d692ce771540f311f77907177cb7f3bd (patch) | |
tree | 02bfb8c1bb5eb52ba5db68702e0998dd7d3c3c88 /Master/texmf-dist/tex/generic | |
parent | 8270d7e0621df4a54b164c501607fb1deecb505d (diff) |
pstricks-add (25dec21)
git-svn-id: svn://tug.org/texlive/trunk@61407 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex | 83 |
1 files changed, 79 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex index 0f165e8c728..22e6fed8cc2 100644 --- a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex +++ b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex @@ -1,4 +1,4 @@ -%% $Id: pstricks-add.tex 1142 2020-02-12 19:07:50Z herbert $ +%% $Id: pstricks-add.tex 358 2021-12-25 09:13:46Z herbert $ %% %% This is file `pstricks-add.tex', %% @@ -31,8 +31,8 @@ \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi \ifx\PSTmathLoaded\endinput\else \input pst-math \fi % -\def\fileversion{3.91} -\def\filedate{2021/09/25} +\def\fileversion{3.92} +\def\filedate{2021/12/25} \let\pstricksaddFV\fileversion \message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)} % @@ -714,7 +714,82 @@ a add laenge Alpha cos mul XC add laenge Alpha sin mul YC add ){#5}% \pcline(#3)(#5)%%%% \psline->\pcline 20140722 -}\ignorespaces} + }\ignorespaces +} +% +\define@key[psset]{pstricks-add}{startColor}[black]{\colorlet{tempcolor}[rgb]{#1}% we need rgb + \pst@getcolor{tempcolor}\ps@startColor} +\define@key[psset]{pstricks-add}{endColor}[white]{\colorlet{tempcolor}[rgb]{#1}% + \pst@getcolor{tempcolor}\ps@endColor} +\define@key[psset]{pstricks-add}{colorsteps}[256]{\pst@getint{#1}\pst@colorsteps}% hv 20211224 +\psset[pstricks-add]{startColor=black,endColor=white,colorsteps=256} +% +\def\psColorLine{\def\pst@par{}\pst@object{psColorLine}} +\def\psColorLine@i{% + \pst@getarrows{% + \begin@OpenObj + \psColorLine@ii}% +} +\def\psColorLine@ii(#1){\@ifnextchar({\psColorLine@iii(#1)}{\psColorLine@iii(0,0)(#1)}}% +\def\psColorLine@iii(#1,#2)(#3,#4){% +% \use@par + \ifx\psk@arrowA\@empty\else\psline[linecolor=\ps@startColor]{->}(!#3 0.5 mul #4 0.5 mul)(#1,#2)\fi + \ifx\psk@arrowB\@empty\else\psline[linecolor=\ps@endColor]{->}(!#1 0.5 mul #2 0.5 mul)(#3,#4)\fi + \pst@getcoor{#1,#2}\pst@tempA + \pst@getcoor{#3,#4}\pst@tempB + \addto@pscode{ + 20 dict begin + [ \psgetRGBColorValues{\ps@startColor} ] aload length 1 eq { dup dup } if + 3 copy 3 array astore /startColor ED + [ \psgetRGBColorValues{\ps@endColor} ] aload length 1 eq { dup dup } if + 3 copy 3 array astore /endColor ED +% on stack R1 G1 B1 R2 G2 B2 + 4 -1 roll % R1 G1 R2 G2 B2 B1 + sub \pst@colorsteps\space div /dB ED % R1 G1 R2 G2 + 3 -1 roll % R1 R2 G2 G1 + sub \pst@colorsteps\space div /dG ED % R1 R2 + exch sub \pst@colorsteps\space div /dR ED + \pst@tempB /Y2 ED /X2 ED + \pst@tempA /Y1 ED /X1 ED + Y2 Y1 sub X2 X1 sub atan /Angle ED + Y2 Y1 sub Angle sin dup 0 eq { pop }{ div } ifelse /L_line ED % line length + \ifx\psk@arrowA\@empty\else + X2 X1 sub L_line div \psk@arrowlength\space mul \pst@number\psxunit mul X1 add /X1 ED + Y2 Y1 sub L_line div \psk@arrowlength\space mul \pst@number\psyunit mul Y1 add /Y1 ED + \fi + \ifx\psk@arrowB\@empty\else + X2 X1 sub L_line div \psk@arrowlength\space mul \pst@number\psxunit mul X2 exch sub /X2 ED + Y2 Y1 sub L_line div \psk@arrowlength\space mul \pst@number\psyunit mul Y2 exch sub /Y2 ED + \fi + Y2 Y1 sub \pst@colorsteps\space 1 add div /dY ED + X2 X1 sub \pst@colorsteps\space 1 add div /dX ED +% dR dG dB == == == +%startColor == endColor == + \ifPst@noCurrentPoint\else\pst@cp\fi % current point? + 0 1 \pst@colorsteps { + /dIndex ED +%startColor == + X1 Y1 moveto + X1 dX add Y1 dY add % start for coordinate array +% gsave + lineto + CP /Y1 ED /X1 ED + \pst@number\pslinewidth SLW + startColor aload pop 3 copy setrgbcolor + % on stack r g b + dB add 3 1 roll % b+dB r g + dG add 3 1 roll % b+dB g+dG r + dR add 3 1 roll % b+dB g+dG r+dR + 3 array astore /startColor ED + \tx@setStrokeTransparency + stroke +% grestore + } for + end % of local part + }% + \end@OpenObj + \ignorespaces +} % \def\psIntersectionPoint(#1)(#2)(#3)(#4)#5{% \pst@getcoor{#1}\pst@tempA |