summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/gradback
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/gradback
Initial commit
Diffstat (limited to 'macros/latex/contrib/gradback')
-rw-r--r--macros/latex/contrib/gradback/gradback.sty57
1 files changed, 57 insertions, 0 deletions
diff --git a/macros/latex/contrib/gradback/gradback.sty b/macros/latex/contrib/gradback/gradback.sty
new file mode 100644
index 0000000000..ca307a5173
--- /dev/null
+++ b/macros/latex/contrib/gradback/gradback.sty
@@ -0,0 +1,57 @@
+% gradient background
+%% File: gradback.sty Copyright (C) 2002 Bjoern Pedersen
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.2
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.2 or later is part of all distributions of LaTeX
+%% version 1999/12/01 or later.
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{gradback}[2002/05/08 gradient background]
+\RequirePackage{pst-grad}
+\def\gr@dBOPhook{/bop-hook}
+\def\gr@dUserDictCmd{! userdict }
+
+%%\gr@dientbackground{firstcolor}{lastcolor}{lines}{midpoint}{angle}
+\DeclareRobustCommand{\gr@dientbackground}[5]{%
+\AtBeginDvi{\special{
+ \gr@dUserDictCmd begin
+ /gr@d-old-BOPhook { } def
+ userdict \gr@dBOPhook\ known{
+ /gr@d-old-BOPhook \gr@dBOPhook load def
+ } if
+ \gr@dBOPhook { gr@d-old-BOPhook
+ gsave clippath tx@Dict begin
+ gsave #1 grestore
+ gsave #2 grestore
+ #3 #4 #5 tx@GradientDict begin GradientFill end end grestore }
+ def end
+}}%
+}%end newcommand
+%%\rgbgradientbackground{r g b}{r g b}{lines}{midpoint}{angle}
+\DeclareRobustCommand{\rgbgradientbackground}[5]{\gr@dientbackground{#1
+ setrgbcolor}{#2 setrgbcolor}{#3}{#4}{#5}}
+%%\hsbgradientbackground{h s b}{h s b}{lines}{midpoint}{angle}
+\DeclareRobustCommand{\hsbgradientbackground}[5]{\gr@dientbackground{#1
+ sethsbcolor currentrgbcolor }{#2 sethsbcolor currentrgbcolor}{#3}{#4}{#5}}
+%%\cymkgradientbackground{c y m k}{c y m k}{lines}{midpoint}{angle}
+\DeclareRobustCommand{\cymkgradientbackground}[5]{\gr@dientbackground{#1
+ setcymkcolor currentrgbcolor }{#2 setcymkcolor currentrgbcolor}{#3}{#4}{#5}}
+%% end gradient background