diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-09 01:01:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-09 01:01:02 +0000 |
commit | 4a6fbdc0e89fde6f9efcaa24de3db8e137da4404 (patch) | |
tree | efe2b5d7e2f07d6ce478982a9b1e5f43d41cb56c /Master/texmf-dist/dvips/pst-ghsb | |
parent | 524dc4b7a5d60a1c703450ac6fd3749ffe81afa3 (diff) |
trunk/Master/texmf-dist/dvips
git-svn-id: svn://tug.org/texlive/trunk@88 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips/pst-ghsb')
-rw-r--r-- | Master/texmf-dist/dvips/pst-ghsb/pst-ghsb.pro | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/Master/texmf-dist/dvips/pst-ghsb/pst-ghsb.pro b/Master/texmf-dist/dvips/pst-ghsb/pst-ghsb.pro new file mode 100644 index 00000000000..23dc9135cf7 --- /dev/null +++ b/Master/texmf-dist/dvips/pst-ghsb/pst-ghsb.pro @@ -0,0 +1,90 @@ +%! +% -*- Mode: Postscript -*- +% pst-ghsb.pro --- PostScript header file pst-ghsb.pro +% For the PSTricks HSB mode gradient fillstyle +% Based on pst-grad.pro from Timothy van Zandt +% Syntax: +% H0 S0 B0 H1 S1 B1 MidPoint NumLines Angle GradientFillHSB +% +% Author : Denis GIROU (CNRS/IDRIS - France) <Denis.Girou@idris.fr> +% Created the : Tue May 13 11:12:36 1997 +% Version : 1.0 +% Last mod. by : Denis GIROU (CNRS/IDRIS - France) <Denis.Girou@idris.fr> +% Last mod. the : Wed May 14 18:48:03 1997 +% + +% Syntax: +% H0 S0 B0 H1 S1 B1 NumLines MidPoint Angle GradientFillHSB + +/tx@GradientHSBDict 40 dict def +tx@GradientHSBDict begin +/GradientFillHSB { + rotate + /MidPoint ED + /NumLines ED + /LastBrightness ED + /LastSaturation ED + /LastHue ED + /FirstBrightness ED + /FirstSaturation ED + /FirstHue ED + % This avoids gaps due to rounding errors: + clip + pathbbox %leave llx,lly,urx,ury on stack + /y ED /x ED + 2 copy translate + y sub neg /y ED + x sub neg /x ED + % This avoids gaps due to rounding errors: + LastHue FirstHue add 2 div + LastSaturation FirstSaturation add 2 div + LastBrightness FirstBrightness add 2 div + sethsbcolor + fill + /YSizePerLine y NumLines div def + /CurrentY 0 def + /MidLine NumLines 1 MidPoint sub mul abs cvi def + MidLine NumLines 2 sub gt + { /MidLine NumLines def } + { MidLine 2 lt { /MidLine 0 def } if } + ifelse + MidLine 0 gt + { + /Hue FirstHue def + /Saturation FirstSaturation def + /Brightness FirstBrightness def + /HueIncrement LastHue FirstHue sub MidLine 1 sub div def + /SaturationIncrement LastSaturation FirstSaturation sub MidLine 1 sub + div def + /BrightnessIncrement LastBrightness FirstBrightness sub MidLine 1 sub + div def + MidLine { GradientLoopHSB } repeat + } if + MidLine NumLines lt + { + /Hue LastHue def + /Saturation LastSaturation def + /Brightness LastBrightness def + /HueIncrement FirstHue LastHue sub NumLines MidLine sub 1 sub div def + /SaturationIncrement FirstSaturation LastSaturation sub + NumLines MidLine sub 1 sub div def + /BrightnessIncrement FirstBrightness LastBrightness sub + NumLines MidLine sub 1 sub div def + NumLines MidLine sub { GradientLoopHSB } repeat + } if +} def +/GradientLoopHSB { + 0 CurrentY moveto + x 0 rlineto + 0 YSizePerLine rlineto + x neg 0 rlineto + closepath + Hue Saturation Brightness sethsbcolor fill + /CurrentY CurrentY YSizePerLine add def + /Brightness Brightness BrightnessIncrement add def + /Saturation Saturation SaturationIncrement add def + /Hue Hue HueIncrement add def +} def + +end +% END pst-ghsb.pro |