Sync-to-go: update copyright for 2015
[s-roff.git] / contrib / hdtbl / examples / rainbow.roff
blob4c037be5dd168064d0fd528b83c3e2a379ceaeb5
1 .ig
2 @ rainbow.roff
4 Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
6 Copyright (C) 2005, 2006 Free Software Foundation, Inc.
7 written by Joachim Walsdorff <Joachim.Walsdorff@urz.uni-heidelberg.de>.
9 This is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
12 version.
14 This is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 for more details.
19 You should have received a copy of the GNU General Public License
20 along with groff; see the file COPYING.  If not, write to the Free
21 Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
22 02110-1301, USA.
25 .time start
27 .nr *n 25
28 .nr *# 0 1
30 .de ctab
31 .  nr #cc 0
32 .  PN \\$1 \
33      ".nr #cc +(1f / \\$1)" \
34      ".defcolor \En[t*#] rgb \\$2 \\$3 \\$4" \
35      ".TBL csp=\n[l]/(12*\\$1+2) border= cpd=0 bgc=\\\\n[t*#] bc=" \
36        ".if (\\\\n+[*#] == 1) \
37           .CPTN Rainbow Colors \[em] Nested Tables with Colored Backgrounds \
38                 val=b" \
39        .TR \
40          .TD
43 .ctab \n[*n] 1            0           \En[#cc]u      \" rot     -> magenta
44 .ctab \n[*n] 1-\En[#cc]u  0           1              \" magenta -> blue
45 .ctab \n[*n] 0            \En[#cc]u   1              \" blue    -> cyan
46 .ctab \n[*n] 0            1           1-\En[#cc]u    \" cyan    -> green
47 .ctab \n[*n] \En[#cc]u    1           0              \" green   -> yellow
48 .ctab \n[*n] 1            1-\En[#cc]u 0              \" yellow  -> red
50 .PN 6*\n[*n] .ETB
52 .time end
54 .bp
56 .time start
58 .nr *n 25
59 .nr *# 0 1
61 .de ctab
62 .  nr #cc 0
63 .  PN \\$1 \
64      ".nr #cc +(1f / \\$1)" \
65      ".defcolor \En[t*#] rgb \\$2 \\$3 \\$4" \
66      ".TBL border=\n[l]/(12*\\$1+2) csp=0 cpd=0 bc=\\\\n[t*#] bgc=" \
67        ".if (\\\\n+[*#] == 1) \
68           .CPTN Rainbow Colors \[em] Nested Tables with Colored Borders \
69                 val=b" \
70        .TR \
71          .TD
74 .ctab \n[*n] 1            \En[#cc]u   0               \" red     -> yellow
75 .ctab \n[*n] 1-\En[#cc]u  1           0               \" yellow  -> green
76 .ctab \n[*n] 0            1           \En[#cc]u       \" green   -> cyan
77 .ctab \n[*n] 0            1-\En[#cc]u 1               \" cyan    -> blue
78 .ctab \n[*n] \En[#cc]u    0           1               \" blue    -> magenta
79 .ctab \n[*n] 1            0           1-\En[#cc]u     \" magenta -> red
81 .PN 6*\n[*n] .ETB
83 .time end
84 .\"     466MHz Celeron CPU, 384MB RAM
85 .\"     WindowsXP/cygwin groff18.1:     11/10s
86 .\"     WindowsXP/cygwin groff19.2:     57/55s
87 .\"     Suse Linux 9.3 groff19.2:         8/8s
88 .\" s-tr-mode