summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/pdftexdef/test/test-hsb.tex
blob: 0fe6025a4d764b5bb6f8a6b53b6a0788c335d17e (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
147
148
149
150
151
152
153
\documentclass[12pt]{article}
\usepackage{color}
\usepackage{longtable}
\usepackage{ifpdf}

\makeatletter
\ifpdf
  \def\pstest#1{\typeout{#1\space\@percentchar\space PSTEST}}
\else
  \let\pstest\@gobble
\fi

\pstest{\@percentchar!PS-Adobe}
\pstest{(test-hsb2rgb.ps) runlibfile}
\AtEndDocument{\pstest{quit}}

\newcommand*{\test}[2][hsb]{%
  \textcolor[#1]{#2}{%
    \let\pstext\relax
    \xdef\rgbtext{\expandafter\rgb\current@color\relax}%
    \let\pstext\@firstofone
    Hello World %
    \pstest{\hsb[#1] #2\relax \rgbtext test}%
  }%
  &
  \let\pstext\@gobble
  \small \hsb[#1] #2\relax
  &
  \ifpdf
    \let\pstext\@gobble
    \small \rgbtext
  \fi
  \tabularnewline
}
\def\hsb[#1]#2,#3,#4\relax{#2 #3 #4\pstext{ #1 }}
\ifpdf
  \def\rgb#1 #2 #3 rg #4 #5 #6 RG\relax{#1 #2 #3\pstext{ rgb }}
\else
  \def\rgb hsb #1 #2 #3\relax{}
\fi
\makeatother

\begin{document}
\begin{longtable}{lll}
\bfseries Text &\bfseries HSB &\ifpdf\bfseries RGB\fi\\
\hline
\endhead
\test{1,1,1}
\test{.5,.5,.5}
\test{0,0,0}
\test{1,0,0}
\test{0,1,0}
\test{0,0,1}
\test{1,1,0}
\test{1,0,1}
\test{.99,0,1}
\test{0,1,1}
\ifpdf
\test[HSB]{0,255,255}
\test[HSB]{0,100,200}
\test[HSB]{0,200,100}
\test[HSB]{20,255,255}
\test[HSB]{20,100,200}
\test[HSB]{20,200,100}
\test[HSB]{40,255,255}
\test[HSB]{40,100,200}
\test[HSB]{40,200,100}
\test[HSB]{60,255,255}
\test[HSB]{60,100,200}
\test[HSB]{60,200,100}
\test[HSB]{80,255,255}
\test[HSB]{80,100,200}
\test[HSB]{80,200,100}
\test[HSB]{100,255,255}
\test[HSB]{100,100,200}
\test[HSB]{100,200,100}
\test[HSB]{120,255,255}
\test[HSB]{120,100,200}
\test[HSB]{120,200,100}
\test[HSB]{140,255,255}
\test[HSB]{140,100,200}
\test[HSB]{140,200,100}
\test[HSB]{160,255,255}
\test[HSB]{160,100,200}
\test[HSB]{160,200,100}
\test[HSB]{180,255,255}
\test[HSB]{180,100,200}
\test[HSB]{180,200,100}
\test[HSB]{200,255,255}
\test[HSB]{200,100,200}
\test[HSB]{200,200,100}
\test[HSB]{220,255,255}
\test[HSB]{220,100,200}
\test[HSB]{220,200,100}
\test[HSB]{240,255,255}
\test[HSB]{240,100,200}
\test[HSB]{240,200,100}
\test[HSB]{260,255,255}
\test[HSB]{260,100,200}
\test[HSB]{260,200,100}
\test[HSB]{280,255,255}
\test[HSB]{280,100,200}
\test[HSB]{280,200,100}
\test[HSB]{300,255,255}
\test[HSB]{300,100,200}
\test[HSB]{300,200,100}
\test[HSB]{320,255,255}
\test[HSB]{320,100,200}
\test[HSB]{320,200,100}
\test[HSB]{340,255,255}
\test[HSB]{340,100,200}
\test[HSB]{340,200,100}
\test[HSB]{360,255,255}
\test[HSB]{360,100,200}
\test[HSB]{360,200,100}
%
\test[Hsb]{0,.7,.3}
\test[Hsb]{0,.3,.7}
\test[Hsb]{30,.7,.3}
\test[Hsb]{30,.3,.7}
\test[Hsb]{60,.7,.3}
\test[Hsb]{60,.3,.7}
\test[Hsb]{90,.7,.3}
\test[Hsb]{90,.3,.7}
\test[Hsb]{120,.7,.3}
\test[Hsb]{120,.3,.7}
\test[Hsb]{150,.7,.3}
\test[Hsb]{150,.3,.7}
\test[Hsb]{180,.7,.3}
\test[Hsb]{180,.3,.7}
\test[Hsb]{210,.7,.3}
\test[Hsb]{210,.3,.7}
\test[Hsb]{240,.7,.3}
\test[Hsb]{240,.3,.7}
\test[Hsb]{270,.7,.3}
\test[Hsb]{270,.3,.7}
\test[Hsb]{300,.7,.3}
\test[Hsb]{300,.3,.7}
\test[Hsb]{330,.7,.3}
\test[Hsb]{330,.3,.7}
\test[Hsb]{360,.7,.3}
\test[Hsb]{360,.3,.7}
% error cases
\pstest{quit}%
\nonstopmode
\test[hsb]{1.0001,1.0001,1.0001}
\test[HSB]{361,300,300}
\test[HSB]{-10,-10,-10}
\test[Hsb]{360.001,1.0001,1.0001}
\fi
\end{longtable}

\end{document}