texlive[66739] Master/texmf-dist: pst-hsb (2apr23)

commits+karl at tug.org commits+karl at tug.org
Sun Apr 2 22:30:03 CEST 2023


Revision: 66739
          http://tug.org/svn/texlive?view=revision&revision=66739
Author:   karl
Date:     2023-04-02 22:30:03 +0200 (Sun, 02 Apr 2023)
Log Message:
-----------
pst-hsb (2apr23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/pst-hsb/Changes
    trunk/Master/texmf-dist/doc/generic/pst-hsb/README
    trunk/Master/texmf-dist/doc/generic/pst-hsb/pst-hsb-doc.pdf
    trunk/Master/texmf-dist/doc/generic/pst-hsb/pst-hsb-doc.tex
    trunk/Master/texmf-dist/tex/generic/pst-hsb/pst-hsb.tex
    trunk/Master/texmf-dist/tex/latex/pst-hsb/pst-hsb.sty

Modified: trunk/Master/texmf-dist/doc/generic/pst-hsb/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-hsb/Changes	2023-04-02 20:29:09 UTC (rev 66738)
+++ trunk/Master/texmf-dist/doc/generic/pst-hsb/Changes	2023-04-02 20:30:03 UTC (rev 66739)
@@ -1,5 +1,8 @@
 ..... pst-hsb.tex
-0.02  2017-12-17  - small fixes
+0.03  2023-04-02  - added saturation and brightness options
+                    for the macros
+0.02  2021-12-16  - small fixes
+                  - updated doc
 0.01  2012-01-01  - first version
 
 

Modified: trunk/Master/texmf-dist/doc/generic/pst-hsb/README
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-hsb/README	2023-04-02 20:29:09 UTC (rev 66738)
+++ trunk/Master/texmf-dist/doc/generic/pst-hsb/README	2023-04-02 20:30:03 UTC (rev 66739)
@@ -1,3 +1,7 @@
+pst-hsb is a PSTricks related package for plotting lines and
+curves with continous colors. Only colors in the hsb  modell 
+are supported.
+
 If you have one of the official TeX distribution installed, then
 all files are still present or can be installed by using the file manager.
 Otherwise save the files pst-hsb.sty|tex in a directory, which is part of your 
@@ -15,5 +19,6 @@
 %% of the LaTeX Project Public License Distributed from CTAN archives
 %% in directory macros/latex/base/lppl.txt.
 
+hvoss at tug.org
 
-%% $Id: README 350 2021-12-16 10:20:18Z herbert $
+%% $Id: README 380 2021-12-29 15:23:25Z herbert $

Modified: trunk/Master/texmf-dist/doc/generic/pst-hsb/pst-hsb-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/pst-hsb/pst-hsb-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-hsb/pst-hsb-doc.tex	2023-04-02 20:29:09 UTC (rev 66738)
+++ trunk/Master/texmf-dist/doc/generic/pst-hsb/pst-hsb-doc.tex	2023-04-02 20:30:03 UTC (rev 66739)
@@ -1,7 +1,7 @@
-%% $Id: pst-hsb-doc.tex 351 2021-12-16 10:37:40Z herbert $
+%% $Id: pst-hsb-doc.tex 686 2023-04-02 13:03:12Z herbert $
 \RequirePackage{pdfmanagement-testphase}
 \DeclareDocumentMetadata{}
-% $Id: pst-hsb-doc.tex 351 2021-12-16 10:37:40Z herbert $
+% $Id: pst-hsb-doc.tex 686 2023-04-02 13:03:12Z herbert $
 \documentclass[11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small,
     headinclude=false,footinclude=false,twoside]{pst-doc}
 \usepackage{pst-hsb}
@@ -26,7 +26,7 @@
 
 \title{\texttt{pst-hsb}}
 \subtitle{Curves with continoues color; v.\psthsbFV}
-\author{Denis Girout\\Manuel Luque\\Herbert Voß}
+\author{Denis Girou\\Manuel Luque\\Herbert Voß}
 \docauthor{}
 %\date{\today}
 \settitle
@@ -48,7 +48,21 @@
 
 \newpage
 
+\section{Options}
+The macros uses the hsb color model for the continuing setting of the
+colors. hsb is Hue, Saturation and Brightness. All three can be defined by the
+beginning and end value of the sequence. If the values for beginning and end are the
+same then the value will be constant for the whole line and/or curve. The options
+are preset to
 
+\begin{verbatim}
+  HueBegin=0,HueEnd=1,
+  SaturationBegin=1, SaturationEnd=1,
+  BrightnessBegin=1, BrightnessEnd=1,
+\end{verbatim}
+
+
+
 \section{Examples}
 
 \subsection{Lines}
@@ -56,9 +70,11 @@
 \begin{pspicture}(-0.5,-0.5)(11,5)
 % \psgrid(0,-4)(10,4)
 \psaxes{->}(0,0)(11,5)
-\pslineHSB[linewidth=1mm,HueBegin=0,HueEnd=0.5](0,0)(10,1)
-\pslineHSB[linewidth=1mm,HueBegin=0.5,HueEnd=0.7](0,1)(10,3)
-\pslineHSB[linewidth=1mm,HueBegin=0.8,HueEnd=1](0,2)(10,5)
+\pslineHSB[linewidth=1mm,HueBegin=0,HueEnd=0.5](0,0)(10,1)\rput[l](10,1){ 1}
+\pslineHSB[linewidth=1mm,HueBegin=0,HueEnd=0.5,SaturationBegin=0](0,0.5)(10,2)\rput[l](10,2){ 2}
+\pslineHSB[linewidth=1mm,HueBegin=0.5,HueEnd=0.7](0,1)(10,3)\rput[l](10,3){ 3}
+\pslineHSB[linewidth=1mm,HueBegin=0.5,HueEnd=0.7,BrightnessBegin=0](0,1.5)(10,4)\rput[l](10,4){ 4}
+\pslineHSB[linewidth=1mm,HueBegin=0.8,HueEnd=1](0,2)(10,5)\rput[l](10,5){ 5}
 \end{pspicture}
 \end{LTXexample}
 

Modified: trunk/Master/texmf-dist/tex/generic/pst-hsb/pst-hsb.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pst-hsb/pst-hsb.tex	2023-04-02 20:29:09 UTC (rev 66738)
+++ trunk/Master/texmf-dist/tex/generic/pst-hsb/pst-hsb.tex	2023-04-02 20:30:03 UTC (rev 66739)
@@ -1,4 +1,4 @@
-%% $Id: pst-hsb.tex 350 2021-12-16 10:20:18Z herbert $
+%% $Id: pst-hsb.tex 686 2023-04-02 13:03:12Z herbert $
 %%
 %% This is file `pst-hsb.tex',
 %%
@@ -6,7 +6,7 @@
 %%
 %% Package `pst-hsb.tex'
 %%
-%% Denis Girout
+%% Denis Girou
 %% Manuel Luque
 %% Herbert Voss <hvoss at tug.org>
 %%
@@ -29,16 +29,26 @@
 % interface to the `xkeyval' package
 \pst at addfams{pst-hsb}
 %
-\def\fileversion{0.02}
-\def\filedate{2021/12/16}
+\def\fileversion{0.03}
+\def\filedate{2023/04/02}
 \message{`PST-hsb' v\fileversion, \filedate\space (hv)}
 %
-\define at key[psset]{pst-hsb}{HueBegin}{\def\psparametricplotHSB at HueBegin{#1}}% Between 0 and 1
-\define at key[psset]{pst-hsb}{HueEnd}{\def\psparametricplotHSB at HueEnd{#1}}% Between 0 and 1
+\define at key[psset]{pst-hsb}{HueBegin}{\def\psHSB at HueBegin{#1}}% 0..1    H
+\define at key[psset]{pst-hsb}{HueEnd}{\def\psHSB at HueEnd{#1}}%     0..1    H
+\define at key[psset]{pst-hsb}{SaturationBegin}{\def\psHSB at SaturationBegin{#1}}% 0..1   S
+\define at key[psset]{pst-hsb}{SaturationEnd}{\def\psHSB at SaturationEnd{#1}}%     0..1   S
+\define at key[psset]{pst-hsb}{BrightnessBegin}{\def\psHSB at BrightnessBegin{#1}}% 0..1   B
+\define at key[psset]{pst-hsb}{BrightnessEnd}{\def\psHSB at BrightnessEnd{#1}}%     0..1   B
+\define at key[psset]{pst-hsb}{ColorBegin}{\pst at getcolor{#1}\ps at ColorBegin}
+\define at key[psset]{pst-hsb}{ColorEnd}{\pst at getcolor{#1}\ps at ColorEnd} 
 \define at boolkey[psset]{pst-hsb}[Pst@]{HSB}[true]{}
 % Default values
-\psset[pst-hsb]{HueBegin=0,HueEnd=1,HSB=true}
-\psset{dimen=outer}
+\psset[pst-hsb]{
+  HueBegin=0,HueEnd=1,
+  SaturationBegin=1, SaturationEnd=1,
+  BrightnessBegin=1, BrightnessEnd=1, 
+  HSB=true,ColorBegin=white,ColorEnd=black}
+\psset{dimen=outer,variableColor=false}
  
 \def\psparametricplotHSB{\pst at object{psparametricplotHSB}}
 \def\psparametricplotHSB at i#1#2#3{{%
@@ -69,11 +79,23 @@
         {\ifPst at HSB % Other points than the first one
           /PointY exch def
           /PointX exch def
-          Counter \psk at plotpoints\space div
-          \psparametricplotHSB at HueEnd\space
-          \psparametricplotHSB at HueBegin\space sub mul
-          \psparametricplotHSB at HueBegin\space add
-          1 1 sethsbcolor
+          Counter \psk at plotpoints\space div /Factor ED
+          \psHSB at HueEnd\space
+          \psHSB at HueBegin\space sub               % HueEnd-HueBegin
+          dup 0 eq { pop \psHSB at HueBegin\space }
+                   { Factor mul \psHSB at HueBegin\space add } ifelse
+          /H_hsb ED 
+          \psHSB at SaturationEnd\space
+          \psHSB at SaturationBegin\space sub 
+          dup 0 eq { pop \psHSB at SaturationBegin\space }
+                   { Factor mul \psHSB at SaturationBegin\space add } ifelse 
+          /S_hsb ED 
+          \psHSB at BrightnessEnd\space
+          \psHSB at BrightnessBegin\space sub
+          dup 0 eq { pop \psHSB at BrightnessBegin\space }
+                   { Factor mul \psHSB at BrightnessBegin\space add } ifelse
+          /B_hsb ED
+          H_hsb S_hsb B_hsb sethsbcolor    % H S B was on stack
           OldX OldY PointX PointY lineto lineto 
           stroke
           PointX PointY moveto
@@ -88,6 +110,12 @@
   \begin at OpenObj
   \pst at getcoor{#1}\pst at tempA
   \pst at getcoor{#2}\pst at tempB
+%  \typeout{\psHSB at HueEnd~
+%          \psHSB at HueBegin~
+%          \psHSB at SaturationBegin~
+%          \psHSB at SaturationEnd~
+%          \psHSB at BrightnessBegin~
+%          \psHSB at BrightnessEnd}%
   \addto at pscode{%
     \pst at tempA 
     /y0 ED /x0 ED
@@ -97,6 +125,11 @@
     /m y1 y0 sub x1 x0 sub div def
     /t x0 dx sub def
     /Counter 0 def
+    \ifPst at variableColor
+      /startWave 
+      lambda dColor add dup /lambda ED 
+      tx at addDict begin wavelengthToRGB Red Green Blue end setrgbcolor
+    \fi
     gsave
     x0 y0 translate
     \psk at plotpoints {
@@ -105,20 +138,37 @@
       t dup m mul
       1 Counter eq 
         { moveto currentpoint /OldY ED /OldX ED } % First point
-        {\ifPst at HSB % Other points than the first one
+        {\ifPst at HSB                               % Other points than the first one
           /PointY exch def
           /PointX exch def
-          Counter \psk at plotpoints\space div
-          \psparametricplotHSB at HueEnd\space
-          \psparametricplotHSB at HueBegin\space sub mul
-          \psparametricplotHSB at HueBegin\space add
-          1 1 sethsbcolor
+          Counter \psk at plotpoints\space div /Factor ED
+          \psHSB at HueEnd\space
+          \psHSB at HueBegin\space sub               % HueEnd-HueBegin
+          dup 0 eq { pop \psHSB at HueBegin\space }
+                   { Factor mul \psHSB at HueBegin\space add } ifelse
+          /H_hsb ED 
+          \psHSB at SaturationEnd\space
+          \psHSB at SaturationBegin\space sub 
+          dup 0 eq { pop \psHSB at SaturationBegin\space }
+                   { Factor mul \psHSB at SaturationBegin\space add } ifelse 
+          /S_hsb ED 
+          \psHSB at BrightnessEnd\space
+          \psHSB at BrightnessBegin\space sub
+          dup 0 eq { pop \psHSB at BrightnessBegin\space }
+                   { Factor mul \psHSB at BrightnessBegin\space add } ifelse
+          /B_hsb ED
+          H_hsb S_hsb B_hsb sethsbcolor    % H S B was on stack
           OldX OldY PointX PointY lineto lineto 
           stroke
           PointX PointY moveto
-	  /OldX PointX def /OldY PointY def
-         \else lineto \fi 
-        } ifelse
+          /OldX PointX def /OldY PointY def
+         \else 
+           \ifPst at variableColor
+           \else
+             lineto 
+           \fi
+         \fi 
+       } ifelse
      } repeat 
      grestore
    }%

Modified: trunk/Master/texmf-dist/tex/latex/pst-hsb/pst-hsb.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pst-hsb/pst-hsb.sty	2023-04-02 20:29:09 UTC (rev 66738)
+++ trunk/Master/texmf-dist/tex/latex/pst-hsb/pst-hsb.sty	2023-04-02 20:30:03 UTC (rev 66739)
@@ -8,4 +8,4 @@
 %     \@addtofilelist{pst-hsb.pro}}{}%
 
 \endinput
-%% $Id: pst-hsb.sty 350 2021-12-16 10:20:18Z herbert $
+%% $Id: pst-hsb.sty 352 2021-12-16 17:14:59Z herbert $



More information about the tex-live-commits mailing list.