summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex
blob: ebb2abf74c69f0fbff4afe1aeade22949cc4d4b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.

\ProvidesFileRCS{tikzlibraryshadows.code.tex}

\usetikzlibrary{fadings}%


% General options
\tikzset{
  /tikz/shadow scale/.initial=1,
  /tikz/shadow xshift/.initial=0pt,
  /tikz/shadow yshift/.initial=0pt,
}%

% Basic shadow style
\tikzset{
  general shadow/.style={
    preaction={
      #1,
      transform canvas={
        scale around=\pgfkeysvalueof{/tikz/shadow scale}:(current path bounding box.center),
        shift={(\pgfkeysvalueof{/tikz/shadow xshift},\pgfkeysvalueof{/tikz/shadow yshift})}
      },
    }
  },
  every shadow/.style={}
}%



%
% Adds a simple drop shadow to a path
%

\tikzset{
  /tikz/drop shadow/.style={
    general shadow={%
      shadow scale=1,
      shadow xshift=.5ex,
      shadow yshift=-.5ex,
      opacity=.5,
      fill=black!50,
      every shadow,
      #1
    }
  }
}%


%
% Adds a circular drop shadow to a path
%

\tikzset{
  /tikz/circular drop shadow/.style={
    general shadow={%
      shadow scale=1.1,
      shadow xshift=.3ex,
      shadow yshift=-.3ex,
      fill=black!50,
      path fading={circle with fuzzy edge 15 percent},
      every shadow,
      #1
    }
  }
}%



%
% Adds a circular glow to a path
%

\tikzset{
  /tikz/circular glow/.style={
    general shadow={%
      shadow scale=1.25,
      shadow xshift=0pt,
      shadow yshift=0pt,
      fill=black!50,
      path fading={circle with fuzzy edge 15 percent},
      every shadow,
      #1,
    }
  }
}%





%
% Adds a "copy" version of the path behind it.
%

\tikzset{
  /tikz/copy shadow/.style={
    general shadow={%
      /utils/exec={\let\tikz@lib@shadow@fill=\tikz@fillcolor\let\tikz@lib@shadow@draw=\tikz@strokecolor},
      shadow scale=1,
      shadow xshift=.5ex,
      shadow yshift=.5ex,
      fill=\tikz@lib@shadow@fill,
      draw=\tikz@lib@shadow@draw,
      every shadow,
      #1
    }
  }
}%


%
% Adds two "copies" of the path behind it.
%

\tikzset{
  /tikz/double copy shadow/.style={
    general shadow={%
      /utils/exec={\let\tikz@lib@shadow@fill=\tikz@fillcolor\let\tikz@lib@shadow@draw=\tikz@strokecolor},
      shadow scale=1,
      shadow xshift=.5ex,
      shadow yshift=.5ex,
      fill=\tikz@lib@shadow@fill,
      draw=\tikz@lib@shadow@draw,
      #1,
      shadow xshift/.expanded=2*\pgfkeysvalueof{/tikz/shadow xshift},
      shadow yshift/.expanded=2*\pgfkeysvalueof{/tikz/shadow yshift},
    },
    general shadow={%
      /utils/exec={\let\tikz@lib@shadow@fill=\tikz@fillcolor\let\tikz@lib@shadow@draw=\tikz@strokecolor},
      shadow scale=1,
      shadow xshift=.5ex,
      shadow yshift=.5ex,
      fill=\tikz@lib@shadow@fill,
      draw=\tikz@lib@shadow@draw,
      #1,
    },
  }
}%