Debian Codegraph @

texmf-dist/doc/latex/xcolor/xcolor3.tex

raw
1 %%
2 %% This is file `xcolor3.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% xcolor.dtx (with options: `test3')
8 %%
9 %% IMPORTANT NOTICE:
10 %%
11 %% For the copyright see the source file.
12 %%
13 %% Any modified versions of this file must be renamed
14 %% with new filenames distinct from xcolor3.tex.
15 %%
16 %% For distribution of the original source see the terms
17 %% for copying and modification in the file xcolor.dtx.
18 %%
19 %% This generated file may be distributed as long as the
20 %% original source files, as listed above, are part of the
21 %% same distribution. (The sources need not necessarily be
22 %% in the same archive or directory.)
23 %%
24 \ProvidesFile{xcolor3}
25 [2024/09/29 v3.02 Color logging test (UK)]
26 %%
27 %% ----------------------------------------------------------------
28 %% Copyright (C) 2003-2021 by Dr. Uwe Kern <xcolor at ukern dot de>
29 %% 2021-2024 LaTeX Project https://github.com/latex3/xcolor/issues
30 %% ----------------------------------------------------------------
31 %%
32 \def\XCfileversion{v3.02}%
33 \def\XCfiledate{2024/09/29}%
34
35 \listfiles
36 \documentclass[a4paper]{article}
37 \usepackage[showerrors,table,dvipsnames*,hyperref]{xcolor}[2005/12/21]
38 \usepackage[margin=2.25cm]{geometry}
39 \usepackage
40 [\GinDriver,hyperindex=false,bookmarks,bookmarksopen,bookmarksopenlevel=1,%
41 pdftitle={xcolor3 \XCfileversion{} (\XCfiledate)},pdfauthor={Dr. Uwe Kern},%
42 pdfsubject={Color extensions for LaTeX and pdfLaTeX},%
43 pdfkeywords={xcolor,color,colour,model,tint,tone,shade,harmony,spot,latex,pdftex,dvips,%
44 conversion,blend,mix,mask,separation,rgb,cmy,cmyk,hsb,gray,html,wave,thsb,wheel}]{hyperref}
45
46 \tracingcolors=4
47 %%\tracingcolors=3
48 %%\tracingcolors=2
49 %%\tracingcolors=1
50 %%\tracingcolors=0
51
52 \parindent0pt
53 \pagecolor{gray!25}
54
55 \definecolors{JungleGreen,DarkOrchid}
56
57 \begin{document}
58 \title{Color extensions with the \textsf{xcolor} package --- various examples}
59 \author{\href{mailto:[email protected]}{\fboxrule0pt\fboxsep2pt\fbox{Dr. Uwe Kern}}}
60 \date{\XCfileversion{} (\XCfiledate)
61 \thanks{This file (\texttt{\jobname.tex}) is part of the \textsf{xcolor} distribution which can be downloaded from the CTAN mirrors \texttt{\href{http://www.ctan.org/tex-archive/macros/latex/contrib/xcolor/}{CTAN/macros/latex/contrib/xcolor/}} or the homepage \texttt{\href{http://www.ukern.de/tex/xcolor.html}{www.ukern.de/tex/xcolor.html}}. Please send error reports and suggestions for improvements to \url{https://github.com/latex3/xcolor/issues}.}}
62 \maketitle
63
64 The purpose of this file is to demonstrate a variety of capabilities including the logging facilities of the \textsf{xcolor} package.
65 By playing around with different values of \texttt{\string\tracingcolors}, one can observe the different behavior in the \texttt{log} file.
66
67 \section{Predefined colors}
68
69 \begingroup
70 \small\sffamily
71 \rowcolors1{}{}
72 \begin{testcolors}[rgb,cmyk,hsb,HTML,gray]
73 \testcolor{red}
74 \testcolor{green}
75 \testcolor{blue}
76 \testcolor{cyan}
77 \testcolor{magenta}
78 \testcolor{yellow}
79 \testcolor{orange}
80 \testcolor{violet}
81 \testcolor{purple}
82 \testcolor{brown}
83 \testcolor{pink}
84 \testcolor{olive}
85 \testcolor{black}
86 \testcolor{darkgray}
87 \testcolor{gray}
88 \testcolor{lightgray}
89 \testcolor{white}
90 \noalign{\medskip}\hline\noalign{\medskip}
91 \testcolor{-red}
92 \testcolor{-green}
93 \testcolor{-blue}
94 \testcolor{-cyan}
95 \testcolor{-magenta}
96 \testcolor{-yellow}
97 \testcolor{-orange}
98 \testcolor{-violet}
99 \testcolor{-purple}
100 \testcolor{-brown}
101 \testcolor{-pink}
102 \testcolor{-olive}
103 \testcolor{-black}
104 \testcolor{-darkgray}
105 \testcolor{-gray}
106 \testcolor{-lightgray}
107 \testcolor{-white}
108 \noalign{\medskip}\hline\noalign{\medskip}
109 \testcolor{JungleGreen}
110 \testcolor{DarkOrchid}
111 \noalign{\medskip}\hline\noalign{\medskip}
112 \testcolor{-JungleGreen}
113 \testcolor{-DarkOrchid}
114 \end{testcolors}
115 \endgroup
116
117 \vfill
118
119 \clearpage
120 \nopagecolor
121 Switch off \texttt{\string\pagecolor} by \texttt{\string\nopagecolor}.
122 The driver may or may not obey this command \dots
123
124 \clearpage
125 \pagecolor{white}
126
127 \section{Color definition and application}
128
129 \providecolor{dummy}{rgb}{.6,.5,.4}
130 \definecolor{dummy}{rgb}{.6,.5,.4}
131 \providecolor{dummy}{rgb}{.6,.5,.4}
132 \hbox{\textcolor{dummy}{Test with \texttt{\string\definecolor}}}
133
134 \bigskip
135
136 Comma-separated and space-separated definitions:
137
138 \definecolor{c1}{rgb}{.7,.6,.5}
139 \definecolor{c2}{rgb}{.7 .6 .5}
140 \colorlet{c1a}{c1}
141 \colorlet{c2a}{c2}
142
143 \textcolor{c1}{identical} =
144 \textcolor{c2}{identical} =
145 \textcolor{c1a}{identical} =
146 \textcolor{c2a}{identical} =
147 \textcolor[rgb]{.7,.6,.5}{identical} =
148 \textcolor[rgb]{.7 .6 .5}{identical} =
149 \textcolor{rgb,10:red,7;green,6;blue,5}{identical}
150 \textcolor{rgb,15:red,10.5;green,9;blue,7.5}{identical}
151
152 \medskip
153
154 \begingroup
155 \sffamily
156 \begin{testcolors}
157 \testcolor{c1}
158 \testcolor{c2}
159 \testcolor{c1a}
160 \testcolor{c2a}
161 \testcolor[rgb]{.7,.6,.5}
162 \testcolor[rgb]{.7 .6 .5}
163 \testcolor{rgb,10:red,7;green,6;blue,5}
164 \testcolor{rgb,15:red,10.5;green,9;blue,7.5}
165 \end{testcolors}
166 \endgroup
167
168 \bigskip
169
170 \textcolor{rgb:red!50,4;green!25,2}{Another extended color expression (rgb:red!50,4;green!25,2)}.
171
172 \bigskip
173
174 \begingroup
175 \color{black}
176 Test with named colors:\par
177 \color{blue}
178 Test: \textcolor[named]{JungleGreen}{JungleGreen};
179 Test: \textcolor{JungleGreen}{JungleGreen};
180 Test: \textcolor{JungleGreen!50!DarkOrchid}{JungleGreen!50!DarkOrchid};
181 Test: \textcolor{green!50!red}{green!50!red}.
182 \endgroup
183
184 \bigskip
185
186 {\color[rgb]{.4,.5,.6}Test with \texttt{\string\color}}
187
188 \bigskip
189 Current color application:\par
190 \def\test{current, \textcolor{.!50}{50\%}, \textcolor{-.}{complement},
191 \textcolor{yellow!50!.}{mix}}
192 \textcolor{blue}{\test} and \textcolor{red}{\test},\par
193 \def\Test{\color{.!80}Test}
194 \textcolor{blue}{\Test\Test\Test\Test\Test} and
195 \textcolor{red}{\Test\Test\Test\Test\Test}.
196
197 \bigskip
198 Current color test with \texttt{\string\definecolorseries}:\par
199 \begingroup
200 \color{blue}
201 \definecolorseries{foo}{rgb}{last}{.}{-.}
202 \resetcolorseries[5]{foo}
203 \def\test{\hbox to 1em{{\color{foo!!+}\vrule width 1em height 1.5ex}}}
204 Test\test\test\test\test\test\test Test
205
206 \resetcolorseries[5]{foo}
207 \def\test{\hbox to 1em{{\color{foo!!++}\vrule width 1em height 1.5ex}}}
208 Test\test\test\test\test\test\test Test
209
210 \resetcolorseries[5]{foo}
211 \def\test{\hbox to 1em{{\color{foo!![2]}\vrule width 1em height 1.5ex}}}
212 Test\test\test\test\test\test\test Test
213
214 \endgroup
215
216 \section{Color in tables}
217
218 \rowcolors[\hline]{1}{green!25}{yellow!50}
219 \begin{tabular}{ll}
220 test & row \number\rownum\\
221 test & row \number\rownum\\
222 \rowcolor{blue!25}
223 test & row \number\rownum\\
224 test & row \number\rownum\\
225 \hiderowcolors
226 test & row \number\rownum\\
227 test & row \number\rownum\\
228 \showrowcolors
229 test & row \number\rownum\\
230 test & row \number\rownum\\
231 \multicolumn{1}%
232 {>{\columncolor{red!12}}l}{test} & row \number\rownum\\
233 \end{tabular}
234
235 \section{Color information}
236
237 Type test:
238 \makeatletter
239 \@namedef{\string\color@foo1}{foo1{}{}{}{}}\edef\tempa{\XC@type{foo1}}\tempa
240 \@namedef{\string\color@foo2}{\xcolor@{foo2}{}{}{}}\edef\tempb{\XC@type{foo2}}\tempb
241 \@namedef{\string\color@foo3}{\xcolor@{}{foo3}{}{}}\edef\tempc{\XC@type{foo3}}\tempc
242 \@namedef{\string\color@foo4}{\xcolor@{}{}{foo4}{}}\edef\tempd{\XC@type{foo4}}\tempd
243 \makeatother
244
245 \end{document}
246 \endinput
247 %%
248 %% End of file `xcolor3.tex'.