summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lapdf/colors.tex
blob: 1e28ebc4478986120216bd90a01614827daebad2 (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
\input preamble.tex

\newcount\k
\newcount\m
\newcount\n
\newcount\ra
\newcount\rb

\newdimen\a
\newdimen\w
\newdimen\xa
\newdimen\ya
\newdimen\xb
\newdimen\yb

\gdef\Segment(#1,#2){%
 \n=0
 \Whilenum{\n<360}{%
  \m=\n \Mod(\m,15)
  \ifnum\m=0 \Nextcol(\k,96) \fi
  \Dset(\w,0.054) \Mul(\w,#2) \Setwidth(\Np\w)
  \Dset(\a,\n) \Dsub(\a,5.8) \Rad(\Np\a,\a)
  \Cos(\Np\a,\xa) \xb=#2\xa \Mul(\xa,#1)
  \Sin(\Np\a,\ya) \yb=#2\ya \Mul(\ya,#1)
  \Moveto(\Np\xa,\Np\ya) \Lineto(\Np\xb,\Np\yb) \Stroke \Add(\n,3)}
 \White
 \Setwidth(0.03)
 \ifnum#2<5 \Arc(128)(0,0)(0,360)(#2) \Stroke \fi}

% ---------------------------------------------------------------------------
\begin{document}
\unitlength1.5cm

\begin{center}
{\Huge \bf{\Lapdf{} Step-Colors}}
\bigskip

\begin{lapdf}(12,12)(-6,-7)
 \Setcap(0)
 \rb=5
 \k=0
 \Whilenum{\rb>1}{%
  \ra=\rb \Sub(\ra,1)
  {\Segment(\ra,\rb)} \Add(\k,24) \Sub(\rb,1)}

 \n=0
 \White
 \Setwidth(0.03)
 \Whilenum{\n<360}{%
  \Dset(\a,\n) \Dsub(\a,7.5) \Rad(\Np\a,\a)
  \Cos(\Np\a,\xa) \xb=5\xa
  \Sin(\Np\a,\ya) \yb=5\ya
  \Moveto(\Np\xa,\Np\ya) \Lineto(\Np\xb,\Np\yb) \Stroke \Add(\n,15)}

 \n=0
 \Dset(\xa,-4.75)
 \Setwidth(0.105)
 \Resetcol
 \Whilenum{\n<96}{%
  \Nextcol(0,96)
  \Line(\Np\xa,-7)(\Np\xa,-6) \Stroke \Dadd(\xa,0.1) \Add(\n,1)}

 \Black
 \Setwidth(0.02)
 \Rectangle(-4.8,-7)(9.6,1)(0) \Stroke
\end{lapdf}
\bigskip

These are the 96 colors, used for {\it Stepcol(c1,c2,s)} and
{\it Nextcol(c1,c2)}.
\end{center}
\end{document}