summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/xcolor/xcolor3.tex
blob: 975d35c604a2a847b66e48f61d8446112269fa88 (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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
%%
%% This is file `xcolor3.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xcolor.dtx  (with options: `test3')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from xcolor3.tex.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file xcolor.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
\ProvidesFile{xcolor3}
 [2022/06/12 v2.14 Color logging test (UK)]
%%
%% ----------------------------------------------------------------
%% Copyright (C) 2003-2021 by Dr. Uwe Kern <xcolor at ukern dot de>
%%               2021-2022    LaTeX Project https://github.com/latex3/xcolor/issues
%% ----------------------------------------------------------------
%%
\def\XCfileversion{v2.14}%
\def\XCfiledate{2022/06/12}%
\listfiles
\documentclass[a4paper]{article}
\usepackage[showerrors,table,dvipsnames*,hyperref]{xcolor}[2005/12/21]
\usepackage[margin=2.25cm]{geometry}
\usepackage
 [\GinDriver,hyperindex=false,bookmarks,bookmarksopen,bookmarksopenlevel=1,%
  pdftitle={xcolor3 \XCfileversion{} (\XCfiledate)},pdfauthor={Dr. Uwe Kern},%
  pdfsubject={Color extensions for LaTeX and pdfLaTeX},%
  pdfkeywords={xcolor,color,colour,model,tint,tone,shade,harmony,spot,latex,pdftex,dvips,%
   conversion,blend,mix,mask,separation,rgb,cmy,cmyk,hsb,gray,html,wave,thsb,wheel}]{hyperref}

\tracingcolors=4
%%\tracingcolors=3
%%\tracingcolors=2
%%\tracingcolors=1
%%\tracingcolors=0

\parindent0pt
\pagecolor{gray!25}

\definecolors{JungleGreen,DarkOrchid}

\begin{document}
\title{Color extensions with the \textsf{xcolor} package --- various examples}
\author{\href{mailto:xcolor@ukern.de}{\fboxrule0pt\fboxsep2pt\fbox{Dr. Uwe Kern}}}
\date{\XCfileversion{} (\XCfiledate)
\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}.}}
\maketitle

The purpose of this file is to demonstrate a variety of capabilities including the logging facilities of the \textsf{xcolor} package.
By playing around with different values of \texttt{\string\tracingcolors}, one can observe the different behavior in the \texttt{log} file.

\section{Predefined colors}

\begingroup
\small\sffamily
\rowcolors1{}{}
\begin{testcolors}[rgb,cmyk,hsb,HTML,gray]
\testcolor{red}
\testcolor{green}
\testcolor{blue}
\testcolor{cyan}
\testcolor{magenta}
\testcolor{yellow}
\testcolor{orange}
\testcolor{violet}
\testcolor{purple}
\testcolor{brown}
\testcolor{pink}
\testcolor{olive}
\testcolor{black}
\testcolor{darkgray}
\testcolor{gray}
\testcolor{lightgray}
\testcolor{white}
\noalign{\medskip}\hline\noalign{\medskip}
\testcolor{-red}
\testcolor{-green}
\testcolor{-blue}
\testcolor{-cyan}
\testcolor{-magenta}
\testcolor{-yellow}
\testcolor{-orange}
\testcolor{-violet}
\testcolor{-purple}
\testcolor{-brown}
\testcolor{-pink}
\testcolor{-olive}
\testcolor{-black}
\testcolor{-darkgray}
\testcolor{-gray}
\testcolor{-lightgray}
\testcolor{-white}
\noalign{\medskip}\hline\noalign{\medskip}
\testcolor{JungleGreen}
\testcolor{DarkOrchid}
\noalign{\medskip}\hline\noalign{\medskip}
\testcolor{-JungleGreen}
\testcolor{-DarkOrchid}
\end{testcolors}
\endgroup

\vfill

\clearpage
\nopagecolor
Switch off \texttt{\string\pagecolor} by \texttt{\string\nopagecolor}.
The driver may or may not obey this command \dots

\clearpage
\pagecolor{white}

\section{Color definition and application}

\providecolor{dummy}{rgb}{.6,.5,.4}
\definecolor{dummy}{rgb}{.6,.5,.4}
\providecolor{dummy}{rgb}{.6,.5,.4}
\hbox{\textcolor{dummy}{Test with \texttt{\string\definecolor}}}

\bigskip

Comma-separated and space-separated definitions:

\definecolor{c1}{rgb}{.7,.6,.5}
\definecolor{c2}{rgb}{.7 .6 .5}
\colorlet{c1a}{c1}
\colorlet{c2a}{c2}

\textcolor{c1}{identical} =
\textcolor{c2}{identical} =
\textcolor{c1a}{identical} =
\textcolor{c2a}{identical} =
\textcolor[rgb]{.7,.6,.5}{identical} =
\textcolor[rgb]{.7 .6 .5}{identical} =
\textcolor{rgb,10:red,7;green,6;blue,5}{identical}
\textcolor{rgb,15:red,10.5;green,9;blue,7.5}{identical}

\medskip

\begingroup
\sffamily
\begin{testcolors}
\testcolor{c1}
\testcolor{c2}
\testcolor{c1a}
\testcolor{c2a}
\testcolor[rgb]{.7,.6,.5}
\testcolor[rgb]{.7 .6 .5}
\testcolor{rgb,10:red,7;green,6;blue,5}
\testcolor{rgb,15:red,10.5;green,9;blue,7.5}
\end{testcolors}
\endgroup

\bigskip

\textcolor{rgb:red!50,4;green!25,2}{Another extended color expression (rgb:red!50,4;green!25,2)}.

\bigskip

\begingroup
\color{black}
Test with named colors:\par
\color{blue}
Test: \textcolor[named]{JungleGreen}{JungleGreen};
Test: \textcolor{JungleGreen}{JungleGreen};
Test: \textcolor{JungleGreen!50!DarkOrchid}{JungleGreen!50!DarkOrchid};
Test: \textcolor{green!50!red}{green!50!red}.
\endgroup

\bigskip

{\color[rgb]{.4,.5,.6}Test with \texttt{\string\color}}

\bigskip
Current color application:\par
\def\test{current, \textcolor{.!50}{50\%}, \textcolor{-.}{complement},
          \textcolor{yellow!50!.}{mix}}
\textcolor{blue}{\test} and \textcolor{red}{\test},\par
\def\Test{\color{.!80}Test}
\textcolor{blue}{\Test\Test\Test\Test\Test} and
\textcolor{red}{\Test\Test\Test\Test\Test}.

\bigskip
Current color test with \texttt{\string\definecolorseries}:\par
\begingroup
\color{blue}
\definecolorseries{foo}{rgb}{last}{.}{-.}
\resetcolorseries[5]{foo}
\def\test{\hbox to 1em{{\color{foo!!+}\vrule width 1em height 1.5ex}}}
Test\test\test\test\test\test\test Test

\resetcolorseries[5]{foo}
\def\test{\hbox to 1em{{\color{foo!!++}\vrule width 1em height 1.5ex}}}
Test\test\test\test\test\test\test Test

\resetcolorseries[5]{foo}
\def\test{\hbox to 1em{{\color{foo!![2]}\vrule width 1em height 1.5ex}}}
Test\test\test\test\test\test\test Test

\endgroup

\section{Color in tables}

\rowcolors[\hline]{1}{green!25}{yellow!50}
\begin{tabular}{ll}
test & row \number\rownum\\
test & row \number\rownum\\
\rowcolor{blue!25}
test & row \number\rownum\\
test & row \number\rownum\\
\hiderowcolors
test & row \number\rownum\\
test & row \number\rownum\\
\showrowcolors
test & row \number\rownum\\
test & row \number\rownum\\
\multicolumn{1}%
 {>{\columncolor{red!12}}l}{test} & row \number\rownum\\
\end{tabular}

\section{Color information}

Type test:
\makeatletter
\@namedef{\string\color@foo1}{foo1{}{}{}{}}\edef\tempa{\XC@type{foo1}}\tempa
\@namedef{\string\color@foo2}{\xcolor@{foo2}{}{}{}}\edef\tempb{\XC@type{foo2}}\tempb
\@namedef{\string\color@foo3}{\xcolor@{}{foo3}{}{}}\edef\tempc{\XC@type{foo3}}\tempc
\@namedef{\string\color@foo4}{\xcolor@{}{}{foo4}{}}\edef\tempd{\XC@type{foo4}}\tempd
\makeatother

\end{document}
\endinput
%%
%% End of file `xcolor3.tex'.