Debian Codegraph @

texmf-dist/doc/latex/lapdf/colors.tex

raw
1 \input preamble.tex
2
3 \newcount\k
4 \newcount\m
5 \newcount\n
6 \newcount\ra
7 \newcount\rb
8
9 \newdimen\a
10 \newdimen\w
11 \newdimen\xa
12 \newdimen\ya
13 \newdimen\xb
14 \newdimen\yb
15
16 \gdef\Segment(#1,#2){%
17 \n=0
18 \Whilenum{\n<360}{%
19 \m=\n \Mod(\m,15)
20 \ifnum\m=0 \Nextcol(\k,96) \fi
21 \Dset(\w,0.054) \Mul(\w,#2) \Setwidth(\Np\w)
22 \Dset(\a,\n) \Dsub(\a,5.8) \Rad(\Np\a,\a)
23 \Cos(\Np\a,\xa) \xb=#2\xa \Mul(\xa,#1)
24 \Sin(\Np\a,\ya) \yb=#2\ya \Mul(\ya,#1)
25 \Moveto(\Np\xa,\Np\ya) \Lineto(\Np\xb,\Np\yb) \Stroke \Add(\n,3)}
26 \White
27 \Setwidth(0.03)
28 \ifnum#2<5 \Arc(128)(0,0)(0,360)(#2) \Stroke \fi}
29
30 % ---------------------------------------------------------------------------
31 \begin{document}
32 \unitlength1.5cm
33
34 \begin{center}
35 {\Huge \bf{\Lapdf{} Step-Colors}}
36 \bigskip
37
38 \begin{lapdf}(12,12)(-6,-7)
39 \Setcap(0)
40 \rb=5
41 \k=0
42 \Whilenum{\rb>1}{%
43 \ra=\rb \Sub(\ra,1)
44 {\Segment(\ra,\rb)} \Add(\k,24) \Sub(\rb,1)}
45
46 \n=0
47 \White
48 \Setwidth(0.03)
49 \Whilenum{\n<360}{%
50 \Dset(\a,\n) \Dsub(\a,7.5) \Rad(\Np\a,\a)
51 \Cos(\Np\a,\xa) \xb=5\xa
52 \Sin(\Np\a,\ya) \yb=5\ya
53 \Moveto(\Np\xa,\Np\ya) \Lineto(\Np\xb,\Np\yb) \Stroke \Add(\n,15)}
54
55 \n=0
56 \Dset(\xa,-4.75)
57 \Setwidth(0.105)
58 \Resetcol
59 \Whilenum{\n<96}{%
60 \Nextcol(0,96)
61 \Line(\Np\xa,-7)(\Np\xa,-6) \Stroke \Dadd(\xa,0.1) \Add(\n,1)}
62
63 \Black
64 \Setwidth(0.02)
65 \Rectangle(-4.8,-7)(9.6,1)(0) \Stroke
66 \end{lapdf}
67 \bigskip
68
69 These are the 96 colors, used for {\it Stepcol(c1,c2,s)} and
70 {\it Nextcol(c1,c2)}.
71 \end{center}
72 \end{document}