summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gradientframe
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-02-13 23:29:39 +0000
committerKarl Berry <karl@freefriends.org>2011-02-13 23:29:39 +0000
commit40a836aa0762f91efc47feb34ffcd37a3e55074a (patch)
tree37219a9f4367de0864677409f7b8f26048fa5760 /Master/texmf-dist/tex/latex/gradientframe
parent9fa55f9a7454d978f593a04380ba2fec148a72f1 (diff)
gradientframe (13feb11)
git-svn-id: svn://tug.org/texlive/trunk@21387 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/gradientframe')
-rw-r--r--Master/texmf-dist/tex/latex/gradientframe/gradientframe.sty77
1 files changed, 41 insertions, 36 deletions
diff --git a/Master/texmf-dist/tex/latex/gradientframe/gradientframe.sty b/Master/texmf-dist/tex/latex/gradientframe/gradientframe.sty
index fd9d3237599..2df7d257a2f 100644
--- a/Master/texmf-dist/tex/latex/gradientframe/gradientframe.sty
+++ b/Master/texmf-dist/tex/latex/gradientframe/gradientframe.sty
@@ -6,7 +6,7 @@
%%
%% gradientframe.dtx (with options: `package')
%%
-%% LaTeX package gradientframe for simple gradient frames around objects.
+%% LaTeX package gradientframe for simple rectangular gradient frames around objects.
%%
%% Copyright (C) Christian Raue, 2011
%% Send feedback to christian°raue@gmail°com (after being exposed to gravity).
@@ -21,7 +21,7 @@
%% and version 1.3c or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
-%% This work has the LPPL maintenance status 'maintained'.
+%% This work has the LPPL maintenance status "maintained".
%%
%% The Current Maintainer of this work is Christian Raue.
%%
@@ -29,50 +29,55 @@
%% gradientframe.sty.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{gradientframe}[2011/02/10 v0.1a simple gradient frames around objects]
+\ProvidesPackage{gradientframe}[2011/02/13 v0.2 simple gradient frames around objects]
\RequirePackage{color}
-\newcommand{\gradientframe}[2][0mm]{%
-\definecolor{gray98}{gray}{.98}%
-\definecolor{gray96}{gray}{.96}%
-\definecolor{gray94}{gray}{.94}%
-\definecolor{gray92}{gray}{.92}%
-\definecolor{gray90}{gray}{.90}%
-\definecolor{gray88}{gray}{.88}%
-\definecolor{gray86}{gray}{.86}%
-\definecolor{gray84}{gray}{.84}%
-\definecolor{gray82}{gray}{.82}%
-\definecolor{gray80}{gray}{.80}%
-\definecolor{gray78}{gray}{.78}%
-\definecolor{gray76}{gray}{.76}%
-\definecolor{gray74}{gray}{.74}%
-\definecolor{gray72}{gray}{.72}%
-\definecolor{gray70}{gray}{.70}%
-\newdimen\lineWidth%
-\lineWidth=0.3px%
-\newdimen\borderSpacing%
-\borderSpacing=#1%
-\fboxrule=\lineWidth%
-\fboxsep=\lineWidth%
-\fcolorbox{gray98}{gray96}{%
-\fcolorbox{gray94}{gray92}{%
-\fcolorbox{gray90}{gray88}{%
-\fcolorbox{gray86}{gray84}{%
-\fcolorbox{gray82}{gray80}{%
-\fcolorbox{gray78}{gray76}{%
-\fcolorbox{gray74}{gray72}{%
-\fboxrule=\lineWidth%
-\fboxsep=\borderSpacing%
-\fcolorbox{gray70}{white}{%
-#2%
+\RequirePackage{keyval}
+\define@key{gradientframe}{linewidth}{%
+\newdimen\gradientframe@linewidth%
+\setlength{\gradientframe@linewidth}{#1}%
}%
+\define@key{gradientframe}{padding}{%
+\newdimen\gradientframe@padding%
+\setlength{\gradientframe@padding}{#1}%
}%
+\newcommand{\gradientframe@defaults}{%
+\setkeys{gradientframe}{%
+linewidth=0.3px,%
+padding=0mm%
}%
}%
+\newdimen\gradientframe@origlinewidth%
+\newcommand{\gradientframe@drawbox}[3]{%
+\fcolorbox[gray]{#1}{#2}{%
+#3%
}%
}%
+\newcommand{\gradientframe}[2][]{%
+\gradientframe@defaults% apply defaults
+\setkeys{gradientframe}{#1}%
+\begingroup% limit redefinitions to this block
+\setlength{\gradientframe@origlinewidth}{\fboxrule}%
+\setlength{\fboxrule}{\gradientframe@linewidth}%
+\setlength{\fboxsep}{\gradientframe@linewidth}% space between frame and object
+\gradientframe@drawbox{.98}{.96}{%
+\gradientframe@drawbox{.94}{.92}{%
+\gradientframe@drawbox{.90}{.88}{%
+\gradientframe@drawbox{.86}{.84}{%
+\gradientframe@drawbox{.82}{.80}{%
+\gradientframe@drawbox{.78}{.76}{%
+\gradientframe@drawbox{.74}{.72}{%
+\setlength{\fboxrule}{\gradientframe@origlinewidth}% restore original \fboxrule value
+\setlength{\fboxsep}{\gradientframe@padding}%
+\gradientframe@drawbox{.70}{1}{#2}%
}%
}%
}%
+}%
+}%
+}%
+}%
+\endgroup%
+}%
\endinput
%%
%% End of file `gradientframe.sty'.