summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/xcolor
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2006-10-04 08:43:01 +0000
committerNorbert Preining <preining@logic.at>2006-10-04 08:43:01 +0000
commitba9472aebfed07843bc4faa00c7b96bc86194691 (patch)
tree4a952a012e2f1663beaac6384dec265fb50dd361 /Master/texmf-dist/source/latex/xcolor
parenta88bdfe70c672cfced299babf0a54881a916bcca (diff)
Fix ctan2tds for pgf installation
comment powerdot-doc-vn in tpm-ctan-check, it always breaks Update of the following packages: labelcas pstricks-add sectionbox ltxmisc frenchle flowfram verse emulateapj pst-pdf poemscol babelbib dk-bib breakurl screenplay ncctools xkeyval bibleref muthesis pst-labo pgf ncclatex active-conf xcolor commath lineno dottex makeplo git-svn-id: svn://tug.org/texlive/trunk@2240 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/xcolor')
-rw-r--r--Master/texmf-dist/source/latex/xcolor/xcolor.dtx2944
1 files changed, 2193 insertions, 751 deletions
diff --git a/Master/texmf-dist/source/latex/xcolor/xcolor.dtx b/Master/texmf-dist/source/latex/xcolor/xcolor.dtx
index 04fc084392c..92b4ea5e712 100644
--- a/Master/texmf-dist/source/latex/xcolor/xcolor.dtx
+++ b/Master/texmf-dist/source/latex/xcolor/xcolor.dtx
@@ -17,8 +17,8 @@
%%
%</package>
%<*extract|driver|test1|test2|test3|test4>
-\def\XCfileversion{v2.06}%
-\def\XCfiledate{2005/10/15}%
+\def\XCfileversion{v2.09}%
+\def\XCfiledate{2005/12/21}%
%</extract|driver|test1|test2|test3|test4>
%
% This file may be distributed and/or modified under the
@@ -33,7 +33,7 @@
%
% \fi
%
-% \CheckSum{4242}
+% \CheckSum{4875}
%
% \DoNotIndex{\def,\gdef,\edef,\xdef,\long,\let}
% \DoNotIndex{\ifnum,\ifdim,\iftrue,\iffalse,\ifx,\ifcase,\else,\or,\fi}
@@ -106,8 +106,8 @@
[\GinDriver,hyperindex=false,bookmarks,bookmarksopen,bookmarksopenlevel=1,%
pdftitle={xcolor \XCfileversion{} (\XCfiledate)},pdfauthor={Dr. Uwe Kern},%
pdfsubject={Color extensions for LaTeX and pdfLaTeX},%
- pdfkeywords={xcolor,color,colour,model,tint,tone,shade,spot,latex,pdftex,dvips,%
- conversion,blend,mix,mask,separation,rgb,cmy,cmyk,hsb,gray,html,wave}]{hyperref}
+ 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}
\OnlyDescription
\EnableCrossrefs
\CodelineIndex
@@ -142,6 +142,7 @@
\generate{
\ukfile0{xcolor}{package}{LaTeX color extensions}
\ukfile2{svgnam}{svgnames}{Predefined colors according to SVG 1.1}
+\ukfile2{x11nam}{x11names}{Predefined colors according to Unix/X11}
\ukfile1{xcolor1}{test1}{Color conversion test}
\ukfile1{xcolor2}{test2}{Pstricks color test}
\ukfile1{xcolor3}{test3}{Color logging test}
@@ -172,6 +173,7 @@
% \DeclareRobustCommand*\Meta{\@ifstar{\@Metatrue\@Meta}{\@Metafalse\@Meta}}
% \newcommand*\@Meta[2][]{\meta{#2}\@ifxempty{#1}{}{\ensuremath{\mskip-1mu\rule[-.4ex]{0pt}{1ex}_{#1}}}\if@Meta\index{arguments\levelchar\meta{#2}\string|usage}\fi}
% \def\DescribeArg#1{\leavevmode\@bsphack\marginpar{\raggedleft\Meta*{#1}}\@esphack\ignorespaces}
+% \def\DescribeFunc#1{\leavevmode\@bsphack\marginpar{\raggedleft\Function{#1}\strut}\@esphack\ignorespaces}
%
% \makeatother
%
@@ -180,11 +182,13 @@
% \def\Program#1{\textsf{\itshape#1}\index{programs\levelchar\textsf{\itshape#1}\string|usage}}
% \def\Model#1{\textsf{\bfseries#1}\index{color models\levelchar\textsf{\bfseries#1}\string|usage}}
% \def\nModel#1{`#1'\index{color models\levelchar`#1'\string|usage}}
+% \def\pModel#1{\textbf{\itshape #1}}
% \def\People#1#2{#1 #2\index{people\levelchar#2, #1\string|usage}}
% \newcommand*\Color[2][+]{\textsl{#2}\ifx#1+\index{color names\levelchar\textsl{#2}\string|usage}\fi}
% \def\Option#1{\texttt{#1}\index{package options\levelchar\texttt{#1}\string|usage}}
% \def\Key#1{\textit{#1}\index{keys\levelchar\textit{#1}\string|usage}}
% \def\File#1{\texttt{#1}\index{files\levelchar\texttt{#1}\string|usage}}
+% \def\Function#1{\textit{#1}\index{color functions\levelchar\textit{#1}\string|usage}}
% \def\Op#1#2{#1\nolimits_{\,\Model{#2}}}
% \def\med{\mathop{\textrm{med}}}
% \def\mix{\mathop{\textrm{mix}}}
@@ -204,6 +208,7 @@
% \def\ItoR#1{\Delta_{#1}}
% \def\bbbN{\textrm{I\kern-.333ex N}}
% \def\bbbR{\textrm{I\kern-.333ex R}}
+% \def\Circ{\textsuperscript{$\circ$}}
%
% \newdimen\XCdim
%
@@ -232,7 +237,7 @@
% \begin{abstract}
% \noindent
% \XC{} provides easy driver-independent access to several kinds of colors, tints, shades, tones, and mixes of arbitrary colors by means of color expressions like |\color{red!50!green!20!blue}|.
-% It allows to select a document-wide target color model and offers tools for automatic color schemes, conversion between nine color models, alternating table row colors, color blending and masking, and color separation.
+% It allows to select a document-wide target color model and offers tools for automatic color schemes, conversion between twelve color models, alternating table row colors, color blending and masking, color separation, and color wheel calculations.
% \end{abstract}
%
% \phantomsection\pdfbookmark[1]{\contentsname}{toc}
@@ -298,9 +303,10 @@
% where |white|, |black|, and |gray| are model-specific constants, see table \vref{tab.const}.
% Further we define the term
% \begin{itemize}
-% \item \textbf{complement}: a color $C^*$ that yields \Color{white} if superposed with the original color $C$.
+% \item \textbf{complement}: a color $C^*$ that yields \Color{white} if superposed with the original color $C$,
% \end{itemize}
-% See section \vref{sec.cnv} for details.
+% knowing that there are also different concepts of complementarity in place (e.g., opposite colors on \emph{color wheels}).
+% See section \vref{sec.cnv} for calculation details and section \vref{sec.harmony} for some remarks on color wheels.
%
%
%
@@ -314,6 +320,40 @@
%
%
%
+% \subsection{Color wheels and color harmony}\label{sec.harmony}
+%
+% There has been a long history of placing colors (hues) on wheels in order to discuss theoretical or practical color issues (e.g., \People{Isaac}{Newton}, \People{Johann Wolfgang von}{Goethe}).
+% One reason may be that the circle itself is a natural tool to demonstrate common relationships as well as opposite properties.
+%
+% Nowadays, there exists some confusion about notions, since both major areas related to color --- art and graphics design on one hand, scientific color theory on the other hand --- tend to use the same words to describe color properties, however meaning sometimes very different facts!
+% Thus, the appearance of color wheels differs as well as the meaning of concepts like `primary' or `complementary' colors.
+%
+%
+% \paragraph{Typical color wheel construction}
+% First, three \emph{primary colors} are placed at 0\Circ, 120\Circ, 240\Circ (artists often choose \Color{red}, \Color{yellow}, \Color{blue}, whereas color scientists might prefer \Color{red}, \Color{green}, \Color{blue}).
+% Next, three \emph{secondary colors} are put at 60\Circ, 180\Circ, 300\Circ.
+% Then, six \emph{tertiary colors} may be placed in between (30\Circ, 90\Circ, \dots).
+% This is why color wheels are frequently described to consist of twelve equidistant colors, although the algorithm can be repeated arbitrarily often.
+%
+%
+% \paragraph{Color harmonies derived from a wheel}
+% We start with an arbitrary color wheel:
+% \begin{itemize}
+% \item \textbf{complementary colors} have a distance of 180\Circ{} on the wheel,
+% \item \textbf{color triads} consist of three colors in 120\Circ{} steps,
+% \item \textbf{color tetrads} consist of four colors in 90\Circ{} steps.
+% \end{itemize}
+% We assume now that the wheel is partitioned into $2n$ sectors of equal size:
+% \begin{itemize}
+% \item \textbf{split complementary colors} of a given color are the two immediate neighbours of its complementary color, characterised by the positions $\frac{n\pm1}{2n}\cdot360^\circ$,
+% \item \textbf{analogous colors} to a given color are its two or four neighbours, characterised by the positions $\pm\frac{1}{2n}\cdot360^\circ$ and $\pm\frac{2}{2n}\cdot360^\circ$.
+% \end{itemize}
+% Given these methods to generate `color harmonies', we conclude that the results depend heavily on how we constructed the wheel!
+% Moreover, the choice of $n$ will affect the visual results as well.
+% Examples are shown in figure \vref{fig.harmony}.
+%
+%
+%
%
% \clearpage
% \section{The User Interface}
@@ -337,9 +377,9 @@
% \begin{itemize}
% \item options that determine the color driver as explained in \cite{dpc} and \cite{color}, currently: \Option{dvips}, \Option{xdvi}, \Option{dvipdf}, \Option{dvipdfm}, \Option{dvipdfmx}, \Option{pdftex}, \Option{dvipsone}, \Option{dviwindo}, \Option{emtex}, \Option{dviwin}, \Option{oztex}, \Option{textures}, \Option{pctexps}, \Option{pctexwin}, \Option{pctexhp}, \Option{pctex32}, \Option{truetex}, \Option{tcidvi}, \Option{vtex}, \Option{xetex},
% \item options that determine the target color model\footnote{Section \vref{sec.tgt} explains how this setting can be overridden at any point in a document.} (\Option{natural}, \Option{rgb}, \Option{cmy}, \Option{cmyk}, \Option{hsb}, \Option{gray}, \Option{RGB}, \Option{HTML}, \Option{HSB}, \Option{Gray}) or disable colored output (\Option{monochrome}),
-% \item options that control whether and how certain sets of predefined colors are being loaded: \Option{dvipsnames}, \Option{dvipsnames*}, \Option{svgnames}, \Option{svgnames*},
+% \item options that control whether and how certain sets of predefined colors are being loaded: \Option{dvipsnames}, \Option{dvipsnames*}, \Option{svgnames}, \Option{svgnames*}, \Option{x11names}, \Option{x11names*},
% \item options that determine which other packages are to be loaded (\Option{table}, \Option{fixpdftex}, \Option{pst}\footnote{\label{fnt.pst}This option will soon become obsolete, since recent \File{pstricks.sty} versions do load \XC, whereas \Package{pstcol} is no longer needed.}) or supported (\Option{hyperref}),
-% \item options that determine the behaviour of other commands: \Option{prologue}, \Option{showerrors}, \Option{hideerrors},
+% \item options that determine the behaviour of other commands: \Option{prologue}, \Option{kernelfbox}, \Option{xcdraw}, \Option{noxcdraw}, \Option{showerrors}, \Option{hideerrors},
% \item obsolete options: \Option{override}, \Option{usenames}, \Option{nodvipsnames}.
% \end{itemize}
% All available package options (except driver selection and obsolete options) are listed in table \vref{tab.opt}.
@@ -377,6 +417,7 @@
% \hline
% \Option{dvipsnames}, \Option{dvipsnames*}& Load a set of predefined colors.\footnotemark[1]\\
% \Option{svgnames}, \Option{svgnames*}& Load a set of predefined colors according to \Index{SVG} 1.1.\footnotemark[1]\\
+% \Option{x11names}, \Option{x11names*}& Load a set of predefined colors according to \Index{Unix}/\Index{X11}.\footnotemark[1]\\
% \hline
% \Option{table}& Load the \Package{colortbl} package, in order to use the tools for coloring rows, columns, and cells within tables.\\
% \Option{fixpdftex}& Load the \Package{pdfcolmk} package, in order to improve |pdftex|'s color behaviour (see section \vref{sec.fixpdftex}).\\
@@ -384,10 +425,15 @@
% \Option{hyperref}& Support the \Package{hyperref} package in terms of color expressions by defining additional keys (see section \vref{sec.hyperref}).\\
% \hline
% \Option{prologue}& Write prologue information to \File{.xcp} file for every color definition (as described in section \vref{sec.prologue}).\\
+% \hline
+% \Option{kernelfbox}& Use \LaTeX{} kernel method to draw \texttt{\string\f(rame)box} frames\footnotemark[2].\\
+% \Option{xcdraw}& Use driver-specific commands to draw frames and color boxes.\footnotemark[2]\\
+% \Option{noxcdraw}& (Default.) Use generic code to draw frames and color boxes.\footnotemark[2]\\
+% \hline
% \Option{showerrors}& (Default.) Display an error message if an undefined color is being used (same behaviour as in the original \LCP).\\
% \Option{hideerrors}& Display only a warning if an undefined color is being used, and replace this color by \Color{black}.\\
% \hline\hline
-% \multicolumn2{c}{\footnotemark[1]\,these options are explained in section \vref{sec.additionalcolors}}\\
+% \multicolumn2{c}{\footnotemark[1]\,See section \vref{sec.additionalcolors}.\quad \footnotemark[2]\,See section \vref{sec.fbox}.}\\
% \hline
% \end{tabularx}
% \end{adjustwidth}
@@ -424,6 +470,8 @@
% \Model{cmy} & cyan, magenta, yellow & \left[0,1\right]^3&& \\
% \Model{cmyk} & cyan, magenta, yellow, black & \left[0,1\right]^4&& \\
% \Model{hsb} & hue, saturation, brightness & \left[0,1\right]^3&& \\
+% \Model{Hsb} & hue\Circ\!, saturation, brightness & \left[0,H\right]\times\left[0,1\right]^2&$H=$& $\mkern-15mu\rangeHsb$\\
+% \Model{tHsb} & hue\Circ\!, saturation, brightness & \left[0,H\right]\times\left[0,1\right]^2&$H=$& $\mkern-15mu\rangeHsb$\\
% \Model{gray} & gray & \left[0,1\right]&& \\
% \Model{RGB} & Red, Green, Blue & \{0,1,\dots,L\}^3& $L\,=$& $\mkern-15mu\rangeRGB$\\
% \Model{HTML} & RRGGBB & \{\texttt{000000},\dots,\texttt{FFFFFF}\}&& \\
@@ -431,7 +479,7 @@
% \Model{Gray} & Gray & \{0,1,\dots,N\}& $N\,=$& $\mkern-15mu\rangeGray$\\
% \Model{wave} & lambda \emph{(nm)}& \left[363,814\right]&& \\
% \hline\hline
-% \multicolumn5{c}{$L,M,N$ are positive integers}\\
+% \multicolumn5{c}{$L,M,N$ are positive integers; $H$ is a positive real number}\\
% \hline
% \end{tabular}
% \end{table}
@@ -443,9 +491,10 @@
% Here is a simple interface to pass commands that should be executed at the end of the \XCP{} (immediately before the initialising |\color{black}| is executed).
% Just say |\def\xcolorcmd|\marg{commands} at some point before \XC{} is loaded.
%
-% Example: assuming that |a.tex| is a complete \LaTeX{} document, the command
-% |latex \def\xcolorcmd{\colorlet{black}{red}}\input{a}|
+% Example: assuming that |a.tex| is a complete \LaTeX{} document, a command like
+% `|latex \def\xcolorcmd{\colorlet{black}{red}}\input{a}|'
% at the console generates a file |a.dvi| with all occurences of \Color{black} being replaced by \Color{red}, without the necessity to change the source file itself.
+% (The exact spelling of the console command might vary across operating systems and \TeX{} distributions.)
%
%
%
@@ -453,20 +502,59 @@
%
% \subsubsection{Supported color models}
%
-% The list of supported color models is given in table \vref{tab.mod}.
+% The list of supported color models and their parameter ranges is given in table \vref{tab.mod}.
% We emphasize that this color support is independent of the chosen driver.
%
% `Color model support' also means that it is possible to specify colors directly with their parameters, e.g., by saying |\textcolor[cmy]{0.7,0.5,0.3}{foo}| (\textcolor[cmy]{0.7,0.5,0.3}{foo}) or |\textcolor[HTML]{AFFE90}{foo}| (\textcolor[HTML]{AFFE90}{foo}).
-% It is noteworthy that the \Model{HTML} model accepts any combination of the characters \texttt0--\texttt9, \texttt A--\texttt F, \texttt a--\texttt f, as long as the string has a length of exactly 6~characters.
-% However, outputs of conversions to \Model{HTML} will always consist of numbers and \emph{uppercase} letters.
%
+% \paragraph{\Model{rgb}, \Model{cmyk}, \Model{hsb}, \Model{gray}}
+% These are the models supported by \Index{PostScript} directly.
+% We therefore refer to \cite{plrm} for a description of their properties and relations.
+% There is a special command
% \DescribeMacro\adjustUCRBG
-% There is a special command to fine-tune the mechanisms of \emph{undercolor-removal} and \emph{black-generation} during conversion to the \Model{cmyk} model, see section \vref{sec.cmy2cmyk} for details.
+% to fine-tune the mechanisms of \emph{undercolor-removal} and \emph{black-generation} during conversion to the \Model{cmyk} model, see section \vref{sec.cmy2cmyk} for details.
%
+% \paragraph{\Model{cmy}}
+% This is mainly a model for intermediary calculation steps.
+% With respect to that, it is a simple complement of \Model{rgb}.
+% As far as visualisation is concerned, \Model{cmy} is treated as \Model{cmyk} with $k=0$.
+%
+% \paragraph{\Model{HTML}}
+% This is a model derived from \Model{rgb} in order to enable input of color parameters from web pages or CSS files.
+% Therefore, it is not really a color model of its own right, but rather a user interface for convenience.
+% It is worth mentioning that \Model{HTML} accepts any combination of the characters |0|--|9|, |A|--|F|, |a|--|f|, as long as the string has a length of exactly 6~characters.
+% However, outputs of conversions to \Model{HTML} will always consist of numbers and \emph{uppercase} letters.
+%
+% \paragraph{\Model{Hsb}, \Model{tHsb}}
+% Firstly, \Model{Hsb} is a `user interface' model, mapping $\emph{hue}\in[0,1]$ onto $\emph{hue\Circ}\in[0,H]$, where $H$ is given by |\def\rangeHsb|\marg{H}.
+% \DescribeMacro\rangeHsb
+% Thus, if $H=360$, we can think of a circle or wheel to specify the \emph{hue\Circ} parameter.
+% Secondly, \Model{Hsb} is the basis for \Model{tHsb}, also named \pModel{tuned} \Model{Hsb}, which enables the user to apply a piecewise linear transformation on \emph{hue\Circ} by shifting selected \emph{hue\Circ} values forward or backward on the circle.
+% This transformation is defined by |\def\rangetHsb{|$x_1,y_1;x_2,y_2;\dots$|}|
+% \DescribeMacro\rangetHsb
+% which specifies that $\emph{hue\Circ}=x_1$ in \Model{tHsb} means $\emph{hue\Circ}=y_1$ in \Model{Hsb}, etc.
+% For example, \Color{yellow} is at 60\Circ{} in the \Model{Hsb} circle (\Color{red} being at 0\Circ), however, in most color wheels used by artists, \Color{yellow} is at 120\Circ.
+% Therefore, a `|120,60|' entry would make sense if we planned to replicate an artist's color wheel via \Model{tHsb}.
+% See section \vref{sec.tHsb2Hsb} for the exact transformation formula and further restrictions, and section \vref{sec.harmony} for color wheels and color harmonies.
+% Figure \vref{fig.tHsb} may serve for comparison purposes.
+%
+% Example: `|\def\rangetHsb{|\texttt{\rangetHsb}|}|' is in fact \XC's default setting.
+%
+% \paragraph{\Model{wave}}
+% With this model we try to make wavelengths transformable to standard color models, in order to approximate the visual appearance of light waves.
+% While the visible spectrum covers a range of approximately 400--750\,nm, the implementation in \XC{} generally allows for all real `wavelengths' $\lambda$ that have an absolute value less than \csname strip@pt\endcsname\maxdimen{} (the biggest number \TeX{} can represent as a dimension).
+% However, the probability of getting any non-black color outside the range of $\lambda\in[363,814]$ is exactly zero.
+% Therefore, figure \vref{fig.spectrum} illustrates only the mentioned wavelength interval.
+% Note that it is not possible to convert other models to \Model{wave} in a sensible way, since the latter covers only a limited range of colors.
+%
+% \paragraph{\Model{RGB}, \Model{HSB}, \Model{Gray}}
+% These are derived models, turning the continuous $[0,1]$ parameter ranges of \Model{rgb}, \Model{hsb}, and \Model{gray} to finite sets of integers; we therefore use the term \emph{integer models}.
+% The constants $L, M, N$ of table \ref{tab.mod} are defined via the commands |\def\rangeRGB|\marg{L},
% \DescribeMacro\rangeRGB
+% |\def\rangeHSB|\marg{M},
% \DescribeMacro\rangeHSB
+% and |\def\rangeGray|\marg{N}.
% \DescribeMacro\rangeGray
-% For the \emph{integer models} \Model{RGB}, \Model{HSB}, and \Model{Gray}, the constants $L, M, N$ of table \ref{tab.mod} are defined via the commands |\def\rangeRGB|\marg{L}, |\def\rangeHSB|\marg{M}, and |\def\rangeGray|\marg{N}.
% Changes of these constants can be done \emph{before} or \emph{after} the \XCP{} is loaded, e.g.,
% \label{ex.range}\begin{verbatim}
% \documentclass{article}
@@ -515,12 +603,13 @@
%
% \begin{table}[p]\caption{Arguments and terminology}\label{tab.term}
% \def\RS{\ensuremath{\to}\space}
-% \small\raggedleft
+% \footnotesize\raggedleft
% \extrarowheight2pt
% \begin{adjustwidth}{-2.5cm}{}
% \advance\textwidth2.5cm
+% \tabcolsep.25em
% \rowcolors{3}{tablerowcolor}{}
-% \begin{tabularx}{\textwidth}{l@{ }X}
+% \begin{tabularx}{\textwidth}{lX}
% \hline
% \rowcolor{tableheadcolor}
% \em Element & \em Replacement string\\
@@ -543,11 +632,13 @@
% \Meta*{core model}& \RS `|rgb|', `|cmy|', `|cmyk|', `|hsb|', `|gray|'\hfill(\emph{core models})\\
% \Meta*{num model}& \RS \Meta{core model}\newline
% \RS `|RGB|', `|HTML|', `|HSB|', `|Gray|'\hfill(\emph{integer models})\newline
-% \RS `|wave|'\hfill(\emph{real model})\\
+% \RS `|Hsb|', `|tHsb|', `|wave|'\hfill(\emph{decimal models})\\
% \Meta*{model}& \RS \Meta{num model}\hfill(\emph{numerical models})\newline
% \RS `|named|'\hfill(\emph{pseudo model})\\
-% \Meta*{model-list}& \RS \Meta[1]{model}|/|\Meta[2]{model}|/.../|\Meta[m]{model} \hfill(\emph{multiple models})\\
+% \Meta*{model-list}& \RS \Meta[1]{model}|/|\Meta[2]{model}|/.../|\Meta[m]{model} \hfill(\emph{multiple models})\newline
+% \RS \Meta{core model}|:|\Meta[1]{model}|/|\Meta[2]{model}|/.../|\Meta[m]{model}\\
% \Meta*{spec}& \RS comma-separated list of numerical values\hfill(\emph{explicit specification})\newline
+% \RS space-separated list of numerical values\hfill(\emph{explicit specification})\newline
% \RS name of a `named' color\hfill(\emph{implicit specification})\\
% \Meta*{spec-list}& \RS \Meta[1]{spec}|/|\Meta[2]{spec}|/.../|\Meta[m]{spec} \hfill(\emph{multiple specifications})\\
% \Meta*{type}& \RS \Meta{empty}\newline
@@ -562,19 +653,23 @@
% \RS |!!|\Meta{plus}\hfill(\emph{series step})\newline
% \RS |!![|\Meta{num}|]|\hfill(\emph{series access})\\
% \hline
-% \Meta*{ext expr}& \RS \Meta{core model}|,|\Meta{div}|:|\Meta[1]{expr}|,|\Meta[1]{dec}|;|\Meta[2]{expr}|,|\Meta[2]{dec}|;...;|\Meta[k]{expr}|!|\Meta[k]{dec}\newline
-% \RS \Meta{core model}|:|\Meta[1]{expr}|,|\Meta[1]{dec}|;|\Meta[2]{expr}|,|\Meta[2]{dec}|;...;|\Meta[k]{expr}|!|\Meta[k]{dec}\\
+% \Meta*{ext expr}& \RS \Meta{core model}|,|\Meta{div}|:|\Meta[1]{expr}|,|\Meta[1]{dec}|;|\Meta[2]{expr}|,|\Meta[2]{dec}|;...;|\Meta[k]{expr}|,|\Meta[k]{dec}\newline
+% \RS \Meta{core model}|:|\Meta[1]{expr}|,|\Meta[1]{dec}|;|\Meta[2]{expr}|,|\Meta[2]{dec}|;...;|\Meta[k]{expr}|,|\Meta[k]{dec}\\
% \hline
-% \Meta*{color}& \RS \Meta{name}\newline
-% \RS \Meta{expr}\newline
-% \RS \Meta{ext expr}\\
+% \Meta*{func expr}& \RS |>|\Meta{function}|,|\Meta[1]{arg}|,|\Meta[2]{arg}|,...,|\Meta[j]{arg}\hfill(\emph{color function expression})\\
+% \Meta*{function}& \RS `|wheel|', `|twheel|'\hfill(\emph{color functions})\\
+% \hline
+% \Meta*{color}& \RS \Meta{color expr}\Meta[1]{func expr}\Meta[2]{func expr}|...|\Meta[i]{func expr}\\
+% \Meta*{color expr}& \RS \Meta{name}\newline
+% \RS \Meta{expr}\newline
+% \RS \Meta{ext expr}\\
% \hline\hline
% \rowcolor{white}
% Remarks:& Each \RS denotes a possible replacement string for the element in the left column;
-% however, further restrictions may apply --- depending on the context.
+% however, further context-dependent restrictions may apply.
% See main text for details.
-% A string `|foo|' is always to be understood without the quotes.\newline
-% $k,l,m,n$ denote positive integers, $m\le8$.\\
+% A string `|foo|' is always to be understood without the quotes.
+% $i,j,k,l,m,n$ denote non-negative integers, $k,l,m,n>0$, $m\le8$.\\
% \hline
% \end{tabularx}
% \end{adjustwidth}
@@ -619,8 +714,8 @@
% \DescribeArg{core model}
% \DescribeArg{num model}
% \DescribeArg{model}
-% The differentiation between \emph{core models} (\Model{rgb}, \Model{cmy}, \Model{cmyk}, \Model{hsb}, \Model{gray}), \emph{integer models} (\Model{RGB}, \Model{HTML}, \Model{HSB}, \Model{Gray}), and \emph{pseudo models} (currently \nModel{named}, \nModel{ps}) has a simple reason: core models with their parameter ranges based on the unit interval $[0,1]$ are best suited for all kinds of calculations, whereas the purpose of the integer models is mainly to facilitate the input of parameters, followed by some transformation into one of the core models.
-% Finally, the real model \Model{wave} (which approximates the visual appearance of light waves) and the pseudo model \nModel{named} have a special status, since they are `calculation-averse': it is usually only possible to convert such a color into one of the other models, but not the other way round.
+% The differentiation between \emph{core models} (\Model{rgb}, \Model{cmy}, \Model{cmyk}, \Model{hsb}, \Model{gray}), \emph{integer models} (\Model{RGB}, \Model{HTML}, \Model{HSB}, \Model{Gray}), \emph{decimal models} (\Model{Hsb}, \Model{tHsb}, \Model{wave}) and \emph{pseudo models} (currently \nModel{named}, \nModel{ps}) has a simple reason: core models with their parameter ranges based on the unit interval $[0,1]$ are best suited for all kinds of calculations, whereas the purpose of the integer models is mainly to facilitate the input of parameters, followed by some transformation into one of the core models.
+% Finally, the decimal models \Model{Hsb} and \Model{tHsb} are special-purpose versions of \Model{hsb}, whereas \Model{wave} and the pseudo model \nModel{named} have a special status, since they are `calculation-averse': it is usually only possible to convert such a color into one of the other models, but not the other way round.
% Even worse for the pseudo model \nModel{ps}: since such colors contain \Index{PostScript} code, they are absolutely intransparent for \TeX.
%
%
@@ -629,7 +724,7 @@
% The \Meta{spec} argument --- which specifies the parameters of a color --- obviously depends on the underlying color model.
% We differentiate between \emph{explicit} and \emph{implicit} specification, the former referring to numerical parameters as explained in table \vref{tab.mod}, the latter --- ideally --- referring to driver-provided names.
%
-% Examples: `|.1,.2,.3|', `|0.56789|', `|89ABCD|', `|ForestGreen|'.
+% Examples: `|.1,.2,.3|', `|.1 .2 .3|', `|0.56789|', `|89ABCD|', `|ForestGreen|'.
%
%
% \paragraph{Multiple models and specifications}
@@ -640,8 +735,9 @@
% First, \Meta{model-spec} is being reconciled with the current target model (as set by a package option or the |\selectcolormodel| command); in case there is no exact match, the first model of the list is chosen.
% Then, the corresponding color specification will be selected from \Meta{spec-list}, such that we arrive at a proper $(\Meta{model}, \Meta{spec})$ pair.
% Therefore, in the actual executed color definition there is no ambiguity anymore.
+% The extended form \Meta{core model}|:|\Meta[1]{model}|/|\Meta[2]{model}|/.../|\Meta[m]{model} causes an immediate conversion of the relevant \Meta{spec} to \Meta{core model}; an unknown target model will be silently ignored here.
%
-% Examples: `|rgb/cmyk/named/gray|', `|0,0,0/0,0,0,1/Black/0|'.
+% Examples: `|rgb/cmyk/named/gray|', `|0,0,0/0,0,0,1/Black/0|', `|rgb:cmy/hsb|'.
%
%
% \paragraph{The type argument}
@@ -654,7 +750,7 @@
% \DescribeArg{prefix}
% \DescribeArg{mix expr}
% \DescribeArg{postfix}
-% These expressions serve as a tool to easily specify a certain form of cascaded color mixing which is described in detail in section \vref{sec.expr-meaning}.
+% These expressions serve as a tool to easily specify a certain form of cascaded color mixing which is described in detail in section~\ref{sec.expr-meaning}.
% The \Meta{prefix} argument controls whether the color following thereafter or its complement will be relevant:
% an odd number of minus signs indicates that the color resulting from the remaining expression has to be converted into its complementary color.
% An \emph{incomplete mix expression} is just an abbreviation for a \emph{complete mix expression} with $\Meta[n]{name} = |white|$, in order to save some keystrokes in the case of tints.
@@ -681,8 +777,19 @@
% Examples: `|rgb:red,1|', `|cmyk:red,1;-green!25!blue!60,11.25;blue,-2|'.
%
%
+% \paragraph{Function expressions}
+% \DescribeArg{func expression}
+% \DescribeArg{function}
+% These expressions extend the functionality of \emph{standard} or \emph{extended} expressions by taking the result of such an expression to perform additional calculations.
+% The number of arguments may vary between different functions, see section \vref{sec.functions} for details.
+%
+% Examples: `|>wheel,30|', `|>wheel,30,|', `|>twheel,1,12|', `|>twheel,-11,12|'.
+%
+%
+%
% \paragraph{Colors}
% \DescribeArg{color}
+% \DescribeArg{color expr}
% Finally, \Meta{color} is the `umbrella' argument, covering the different concepts of specifying colors.
% This means, whenever there is a \Meta{color} argument, the full range of names and expressions, as explained above, may be used.
%
@@ -718,7 +825,7 @@
%
% An \emph{extended color expression}
% \begin{gather*}
-% \Meta{core model}|:|\Meta[1]{expr}|,|\Meta[1]{dec}|;|\Meta[2]{expr}|,|\Meta[2]{dec}|;...;|\Meta[k]{expr}|!|\Meta[k]{dec}
+% \Meta{core model}|:|\Meta[1]{expr}|,|\Meta[1]{dec}|;|\Meta[2]{expr}|,|\Meta[2]{dec}|;...;|\Meta[k]{expr}|,|\Meta[k]{dec}
% \end{gather*}
% mimes color mixing as painters do it: specify a list of colors, each with a \Meta{dec} factor attached to.
% For such an \Meta{ext expr}, each standard color expression \Meta[\kappa]{expr} will be converted to \Meta{core model}, then the resulting vector is multiplied by $\Meta[\kappa]{dec}/\Meta{div}$, where
@@ -732,7 +839,7 @@
% Note that this mechanism can also be used to display an individual color (expression) in a certain color model: |\color{rgb:yellow,1}| results in such a conversion.
% The general form
% \begin{gather*}
-% \Meta{core model}|,|\Meta{div}|:|\Meta[1]{expr}|,|\Meta[1]{dec}|;|\Meta[2]{expr}|,|\Meta[2]{dec}|;...;|\Meta[k]{expr}|!|\Meta[k]{dec}
+% \Meta{core model}|,|\Meta{div}|:|\Meta[1]{expr}|,|\Meta[1]{dec}|;|\Meta[2]{expr}|,|\Meta[2]{dec}|;...;|\Meta[k]{expr}|,|\Meta[k]{dec}
% \end{gather*}
% does the same operation with the only difference that the divisor \Meta{div} is being specified instead of calculated.
% In the above example, we get a shaded version \testclr{rgb,9:red,4;green,2;yellow,1} by saying |\color{rgb,9:red,4;green,2;yellow,1}|.
@@ -740,6 +847,26 @@
% However, the mapping of equation (\ref{eq.U}) takes care of such cases.
%
%
+% \subsubsection{Color functions}\label{sec.functions}
+%
+% Color functions take a comma-separated list of arguments, and they serve to transform the \emph{given color} (i.e., the result of all calculations prior to the function call) into a new color.
+%
+% \paragraph{Color wheel calculations}
+% \DescribeFunc{wheel}
+% \DescribeFunc{twheel}
+% Arguments: \Meta{angle} or \Meta{angle}|,|\Meta{full circle}, the former being an abbreviataion of \Meta{angle}|,\rangeHsb|.
+% These functions allow to calculate related colors by harmonic relations based on color wheels (cf.~section \vref{sec.harmony}).
+% The second argument \Meta{full circle} declares how many units a full circle consists of, the first argument states by how many units the given color has to be rotated.
+% To this end, the given color is first converted to \Model{Hsb} (in case of \Function{wheel}), yielding \emph{hue\Circ}, \emph{saturation}, and \emph{brightness}, respectively.
+% Then
+% \begin{gather}
+% \displaystyle\emph{hue\Circ} := \emph{hue\Circ} + \frac{\Meta{angle}}{\Meta{full circle}}\cdot H, \qquad \emph{hue} := u\Bigl( \frac{\emph{hue\Circ}}{H} \Bigr)
+% \end{gather}
+% where $u$ is the range-reduction function of equation~(\ref{eq.U}) and $H = \texttt{\string\rangeHsb}$.
+% With \emph{saturation} and \emph{brightness} left untouched, the final model is \Model{hsb}.
+% The \Function{twheel} function works similarly, but its arguments refer to \Model{tHsb} instead of \Model{Hsb}.
+% Examples are shown in figure \vref{fig.harmony}.
+%
%
% \subsection{Predefined colors}
%
@@ -760,10 +887,19 @@
% In the latter case, individual color names have to be activated by |\definecolors| or |\providecolors| commands, as described in section \vref{sec.deferred}, before they can be applied in a document.
% \begin{itemize}
% \item \Option{dvipsnames}/\Option{dvipsnames*} loads a set of 68 \Model{cmyk} colors as defined in the |dvips| driver. However, these colors may be used in all supported drivers.
-% \item \Option{svgnames}/\Option{svgnames*} loads a set of 147 \Model{rgb} color names\footnote{In fact, these names represent 138 different colors.} according to the \Index{SVG}~1.1 specification \cite{svg}\footnote{Actually, the cited specification lists only lowercase names, and the original definitions are given in \Model{RGB} parameters, converted to \Model{rgb} by the author.}.
+% \item \Option{svgnames}/\Option{svgnames*} loads a set of 151 \Model{rgb} color names\footnote{In fact, these names represent 141 different colors.} according to the \Index{SVG}~1.1 specification \cite{svg}\footnote{Actually, the cited specification lists only lowercase names, and the original definitions are given in \Model{RGB} parameters, converted to \Model{rgb} by the author.}, enhanced by~4 names taken from the file \File{rgb.txt} which is part of \Index{Unix}/\Index{X11} distributions.
+% \item \Option{x11names}/\Option{x11names*} loads a set of 317 \Model{rgb} color names\footnote{These names represent 315 different colors.} that are basically variations of a subset of the \Index{SVG} set mentioned before, according to the file \File{rgb.txt} which is part of \Index{Unix}/\Index{X11} distributions\footnote{Again, the original definitions are given in \Model{RGB} parameters, converted to \Model{rgb} by the author.}.
+% We describe now how to access all 752 color names of \File{rgb.txt} without much effort:
+% \begin{itemize}
+% \item Load \Option{x11namees} as well as \Option{svgnames}.
+% \item Capitalise initials and skip blanks: \Color[-]{DarkSlateGray} instead of \Color[-]{dark slate gray}.
+% \item \Index{X11} names without numbers are identical to the corresponding \Index{SVG} colors, except in 5~cases:
+% use \Color{Gray0}, \Color{Grey0}, \Color{Green0}, \Color{Maroon0}, \Color{Purple0} instead of \Color[-]{Gray}, \Color[-]{Grey}, \Color[-]{Green}, \Color[-]{Maroon}, \Color[-]{Purple} to obtain the original \Index{X11} colors.
+% \item For $N=0,1,\dots,100$ use `|[gray]{|$N/100$|}|' or `|black!|$100-N$' instead of \Color[-]{grayN} or \Color[-]{greyN}.
+% \end{itemize}
% \end{itemize}
% The color names and corresponding displays are listed in section \vref{sec.names}.
-% Note that --- due to some overlap in the names --- the option order is important, if you plan to use more than one of these sets.
+% Section \vref{sec.clash} describes how to deal with name clashs while using both \Option{svgnames} and \Option{dvipsnames} in the same document.
% See also \cite{chroma} for a systematic set of color and mix examples.
%
%
@@ -815,10 +951,11 @@
% \begin{itemize}
% \item |\definecolor{red}{rgb}{1,0,0}|,
% \item |\definecolor{red}{rgb/cmyk}{1,0,0/0,1,1,0}|,
+% \item |\definecolor{red}{hsb:rgb/cmyk}{1,0,0/0,1,1,0}|,
% \item |\definecolor[named]{Black}{cmyk}{0,0,0,1}|,
% \item |\definecolor{myblack}{named}{Black}|,
% \end{itemize}
-% where the last command is equivalent to |\colorlet{myblack}{Black}| (see below); the second command defines \Color{red} in the \Model{rgb} or \Model{cmyk} model, depending on the current setting of the \emph{target model}.
+% where the last command is equivalent to |\colorlet{myblack}{Black}| (see below); the second command defines \Color{red} in the \Model{rgb} or \Model{cmyk} model, depending on the current setting of the \emph{target model}, whereas the third will additionally transform the color to \Model{hsb} prior to saving.
% Note that there is a special \Package{pstricks} version as described in section \vref{sec.pstricks}.
%
% \medskip
@@ -930,21 +1067,22 @@
%
% \subsubsection{Standard color commands}
%
-% Here is the list of user-level color commands, as known from the \LCP, but with an extended syntax for the colors:\\
+% Here is the list of user-level color commands, as known from the \LCP, but with an extended syntax for the colors, allowing for expressions etc.:\\
% \DescribeMacro\color\marg{color}\\
-% \oarg{model}\marg{spec}\\
+% \oarg{model-list}\marg{spec-list}\\
+% Switches to the color given either by name/expression or by model/specification.
+% This color will stay in effect until the end of the current \TeX\ group.\\
% \DescribeMacro\textcolor\marg{color}\marg{text}\\
-% \oarg{model}\marg{spec}\marg{text}\\
-% \DescribeMacro\colorbox\marg{color}\marg{text}\\
-% \oarg{model}\marg{spec}\marg{text}\\
-% \DescribeMacro\fcolorbox\marg{frame color}\marg{background color}\marg{text}\\
-% \oarg{model}\marg{frame spec}\marg{background spec}\marg{text}\\
+% \oarg{model-list}\marg{spec-list}\marg{text}\\
+% are just alternative syntax for |\color|, in which the groups are added implicitly.
+% Thus \meta{text} appears in the specified color, but then the color reverts to its previous value.
+% Additionally, it calls |\leavevmode| to ensure the start of horizontal mode.\\
% \DescribeMacro\pagecolor\marg{color}\\
-% \oarg{model}\marg{spec}\\
-% Hence, the formal difference to the \LCP{} is that color \emph{expressions} may be used instead of pure color \emph{names}.
-% A previous section explains how color expressions are constructed.
+% \oarg{model-list}\marg{spec-list}\\
+% Specifies the background color for the current, and all following, pages.
+% It is a global declaration which does not respect \TeX\ groups.
%
-% Remark: all of these commands except |\color| require that the \Meta{color} resp.{} \Meta{spec} arguments are put into curly braces |{}|, even if they are buried in macros.
+% Remark: all of these commands except |\color| require that the \Meta{color} resp.\ \Meta{spec} arguments are put into curly braces |{}|, even if they are buried in macros.
%
% For example, after |\def\foo{red}|, one may say |\color\foo|, but one should always write |\textcolor{\foo}{bar}| instead of |\textcolor\foo{bar}| in order to avoid strange results.
%
@@ -952,6 +1090,43 @@
% However, one can turn the expression into a name via |\colorlet| and try to use that name instead.
%
%
+% \subsubsection{Colored boxes}\label{sec.fbox}
+%
+% \DescribeMacro\colorbox\marg{color}\marg{text}\\
+% \oarg{model-list}\marg{spec-list}\marg{text}\\
+% Takes the same argument forms as |\textcolor|, but the color specifies the \emph{background} color of the box.\\
+% \DescribeMacro\fcolorbox\marg{frame color}\marg{background color}\marg{text}\\
+% \oarg{model-list}\marg{frame spec-list}\marg{background spec-list}\marg{text}\\
+% \oarg{fr.~model-list}\marg{fr.~spec-list}\oarg{backgr.~model-list}\marg{backgr.~spec-list}\marg{text}\\
+% \marg{frame color}\oarg{background model-list}\marg{background spec-list}\marg{text}\\
+% Puts a frame of the first color around a box with a background specified by the second color.
+% If only the first optional argument is given, it specifies the color model for both colors.
+% Besides the possibility to specify color \emph{expressions} as arguments, |\fcolorbox| now offers more flexibility for its arguments than the \LC{} version:
+% \begin{itemize}
+% \item \fcolorbox{gray}{yellow}{test} |\fcolorbox{gray}{yellow}{test}|,
+% \item \fcolorbox[cmyk]{0,0,0,0.5}{0,0,1,0}{test} |\fcolorbox[cmyk]{0,0,0,0.5}{0,0,1,0}{test}|,
+% \item \fcolorbox[gray]{0.5}[wave]{580}{test} |\fcolorbox[gray]{0.5}[wave]{580}{test}|,
+% \item \fcolorbox{gray}[wave]{580}{test} |\fcolorbox{gray}[wave]{580}{test}|.
+% \end{itemize}
+% Additionally, |\fcolorbox| uses a new approach to frame drawing, which is an extension of \People{Donald}{Arseneau}'s suggestion in bug report latex/3655 \cite{fbox}.
+% The main difference to \LaTeX's implementation is that box construction and frame drawing are split into separate operations, such that the frame is drawn \emph{after} the box contents has been constructed.
+% This ensures that the frame is always on top of the box.
+% \People{Donald}{Arseneau} improved speed as well as memory requirements of this approach.
+% Furthermore, a new macro is introduced:
+%
+% \DescribeMacro\boxframe\marg{width}\marg{height}\marg{depth}\\
+% Draws a frame with a linewidth of |\fboxrule|.
+% Returns a |\hbox| with outer dimensions \meta{width}, \meta{height}, \meta{depth}.
+% By this approach, a frame-primitive may also be provided by a driver file, in order to exploit driver-specific drawing facilities (see below).
+% Again, this macro was optimised by \People{Donald}{Arseneau}.
+%
+% The new frame approach is used for |\fcolorbox| as well as \LaTeX's |\fbox| and |\framebox| commands, unless the \Option{kernelfbox} option is specified, which returns to \LaTeX's original definitions of |\f(rame)box|.
+%
+% Option \Option{xcdraw} uses \Index{PostScript} commands to draw frames and color boxes in case of the \Option{dvips} driver and \Index{PDF} code to draw frames in case of the \Option{pdftex} and \Option{dvipdfm} drivers.
+% This is still experimental code that may confuse \File{.dvi} viewers.
+% The opposite option \Option{noxcdraw} forces usage of the generic (driver-independent) code.
+%
+%
% \subsubsection{Using the current color}
%
% Within a color expression, `.' serves as a placeholder for the current color.
@@ -972,11 +1147,12 @@
%
% \DescribeMacro\testcolor
% \marg{color}\\
-% \oarg{model}\marg{spec}\\
+% \oarg{model-list}\marg{spec-list}\\
% Each |\testcolor| command generates a table row, containing a display sample plus the respective parameters for each of the models.
% If the column-model matches the model of the color in question, its parameters are underlined.
% Note that this command is only available within the |testcolors| environment.
-% See figure \vref{fig.testcolors} for an example.
+%
+% For applications see figure \vref{fig.testcolors} and figures \ref{fig.tHsb}, \ref{fig.harmony}.
%
%
%
@@ -1152,6 +1328,7 @@
%
%
%
+%
% \subsection{Border colors for hyperlinks}\label{sec.hyperref}
%
% The \Package{hyperref} package offers all kinds of support for hyperlinks, pdfmarks etc.
@@ -1255,10 +1432,24 @@
% Converts a color, given by the \Meta{spec} in model \Meta{model}, into \Meta{target model} and stores the new color specification in |\cmd|.
% \Meta{target model} must be of type \Meta{num model}, whereas \Meta{model} may also be `named', in which case \Meta{spec} is simply the name of the color.
%
+% Example: |\convertcolorspec{cmyk}{0.81,1,0,0.07}{HTML}\tmp| acts like |\def| |\tmp{1F00ED}|.
+%
%
%
% \subsection{Problems and solutions}
%
+% \subsubsection{Name clashs between \Option{dvipsnames} and \Option{svgnames}}\label{sec.clash}
+%
+% Due to the fixed option processing order (which does not depend on the order how the options were specified in the |\usepackage| command), the \Option{svgnames} colors will always overrule \Option{dvipsnames} colors with identical names.
+% This can lead to undesired results if both options are used together.
+% For instance, \Color{Fuchsia} yields \testclr[cmyk]{0.47,0.91,0,0.08} under the regime of \Option{dvipsnames} and \testclr[rgb]{1,0,1} with respect to \Option{svgnames}.
+% However, there is a simple trick --- based on \emph{deferred color definition} --- that allows us to use colors from both sets in the desired way:
+% \begin{verbatim}
+% \usepackage[dvipsnames*,svgnames]{xcolor}
+% \definecolors{Fuchsia}
+% \end{verbatim}
+% Now all colors from the \Index{SVG} set are available (except \Color{Fuchsia}) plus \Color{Fuchsia} from the other set.
+%
% \subsubsection{Page breaks and pdf\TeX}\label{sec.fixpdftex}
%
% Since pdf\TeX{} does not maintain a \emph{\Index{color stack}} --- in contrast to \Program{dvips} --- a typical problem is the behaviour of colors in the case of page breaks, as illustrated by the following example:
@@ -1333,6 +1524,7 @@
% \testcolor{-cyan!50!magenta}
% \testcolor[cmyk]{0,0,1,0.5}
% \testcolor[cmyk]{0,0,.5,.5}
+% \testcolor[rgb:cmyk]{0,0,.5,.5}
% \end{testcolors}
% \end{adjustwidth}
% \vspace*{3ex}
@@ -1345,6 +1537,7 @@
% \testcolor{-cyan!50!magenta}
% \testcolor[cmyk]{0,0,1,0.5}
% \testcolor[cmyk]{0,0,.5,.5}
+% \testcolor[rgb:cmyk]{0,0,.5,.5}
% \end{testcolors}
% \end{verbatim}
% \end{adjustwidth}
@@ -1645,6 +1838,261 @@
% \arrayrulecolor{black}
% \end{figure}
%
+%
+% \begin{figure}[htbp]\caption{\Model{Hsb} and \Model{tHsb}: \emph{hue\Circ} in $15^\circ$ steps}\label{fig.tHsb}
+% \begin{adjustwidth}{-2.5cm}{}
+% \footnotesize\sffamily\raggedleft
+% \extrarowheight.5pt
+% \begin{testcolors}[rgb,cmyk,hsb,Hsb,tHsb]
+% \testcolor[Hsb]{0,1,1}
+% \testcolor[Hsb]{15,1,1}
+% \testcolor[Hsb]{30,1,1}
+% \testcolor[Hsb]{45,1,1}
+% \testcolor[Hsb]{60,1,1}
+% \testcolor[Hsb]{75,1,1}
+% \testcolor[Hsb]{90,1,1}
+% \testcolor[Hsb]{105,1,1}
+% \testcolor[Hsb]{120,1,1}
+% \testcolor[Hsb]{135,1,1}
+% \testcolor[Hsb]{150,1,1}
+% \testcolor[Hsb]{165,1,1}
+% \testcolor[Hsb]{180,1,1}
+% \testcolor[Hsb]{195,1,1}
+% \testcolor[Hsb]{210,1,1}
+% \testcolor[Hsb]{225,1,1}
+% \testcolor[Hsb]{240,1,1}
+% \testcolor[Hsb]{255,1,1}
+% \testcolor[Hsb]{270,1,1}
+% \testcolor[Hsb]{285,1,1}
+% \testcolor[Hsb]{300,1,1}
+% \testcolor[Hsb]{315,1,1}
+% \testcolor[Hsb]{330,1,1}
+% \testcolor[Hsb]{345,1,1}
+% \testcolor[Hsb]{360,1,1}
+% \noalign{\medskip}
+% \testcolor[tHsb]{0,1,1}
+% \testcolor[tHsb]{15,1,1}
+% \testcolor[tHsb]{30,1,1}
+% \testcolor[tHsb]{45,1,1}
+% \testcolor[tHsb]{60,1,1}
+% \testcolor[tHsb]{75,1,1}
+% \testcolor[tHsb]{90,1,1}
+% \testcolor[tHsb]{105,1,1}
+% \testcolor[tHsb]{120,1,1}
+% \testcolor[tHsb]{135,1,1}
+% \testcolor[tHsb]{150,1,1}
+% \testcolor[tHsb]{165,1,1}
+% \testcolor[tHsb]{180,1,1}
+% \testcolor[tHsb]{195,1,1}
+% \testcolor[tHsb]{210,1,1}
+% \testcolor[tHsb]{225,1,1}
+% \testcolor[tHsb]{240,1,1}
+% \testcolor[tHsb]{255,1,1}
+% \testcolor[tHsb]{270,1,1}
+% \testcolor[tHsb]{285,1,1}
+% \testcolor[tHsb]{300,1,1}
+% \testcolor[tHsb]{315,1,1}
+% \testcolor[tHsb]{330,1,1}
+% \testcolor[tHsb]{345,1,1}
+% \testcolor[tHsb]{360,1,1}
+% \end{testcolors}
+% \end{adjustwidth}
+% \end{figure}
+%
+%
+% \begin{figure}[htbp]\caption{Color harmony}\label{fig.harmony}
+% \begin{adjustwidth}{-2.5cm}{}
+% \small\sffamily\raggedleft
+% \extrarowheight1.5pt
+% \begin{testcolors}[rgb,cmyk,Hsb,tHsb]
+% \noalign{\smallskip}
+% \rlap{\em complementary colors (two-color harmony):}\\
+% \testcolor{yellow>wheel,1,2}
+% \testcolor{yellow}
+% \testcolor{yellow>twheel,1,2}
+% \noalign{\medskip}
+% \rlap{\em color triad (three-color harmony):}\\
+% \testcolor{yellow>wheel,2,3}
+% \testcolor{yellow>wheel,1,3}
+% \testcolor{yellow}
+% \testcolor{yellow>twheel,1,3}
+% \testcolor{yellow>twheel,2,3}
+% \noalign{\medskip}
+% \rlap{\em color tetrad (four-color harmony):}\\
+% \testcolor{yellow>wheel,3,4}
+% \testcolor{yellow>wheel,2,4}
+% \testcolor{yellow>wheel,1,4}
+% \testcolor{yellow}
+% \testcolor{yellow>twheel,1,4}
+% \testcolor{yellow>twheel,2,4}
+% \testcolor{yellow>twheel,3,4}
+% \noalign{\medskip}
+% \rlap{\em split complementary colors:}\\
+% \testcolor{yellow>wheel,7,12}
+% \testcolor{yellow>wheel,5,12}
+% \testcolor{yellow}
+% \testcolor{yellow>twheel,5,12}
+% \testcolor{yellow>twheel,7,12}
+% \noalign{\medskip}
+% \rlap{\em analogous (adjacent) colors:}\\
+% \testcolor{yellow>wheel,11,12}
+% \testcolor{yellow>wheel,10,12}
+% \testcolor{yellow>wheel,2,12}
+% \testcolor{yellow>wheel,1,12}
+% \testcolor{yellow}
+% \testcolor{yellow>twheel,1,12}
+% \testcolor{yellow>twheel,2,12}
+% \testcolor{yellow>twheel,10,12}
+% \testcolor{yellow>twheel,11,12}
+% \end{testcolors}
+% \end{adjustwidth}
+% \end{figure}
+%
+% \end{adjustwidth}
+%
+%
+% \clearpage
+%
+% \begin{adjustwidth}{-2.5cm}{}
+% \raggedcolumns\columnsep2.5em
+%
+% \section{Colors by Name}\label{sec.names}
+%
+% \begin{multicols}{5}[\subsection{Base Colors}\label{sec.basenam}]
+% \footnotesize\def\0#1{\Testclr{#1}{#1}}
+% \0{black}
+% \0{blue}
+% \0{brown}
+% \0{cyan}
+% \0{darkgray}
+% \0{gray}
+% \0{green}
+% \0{lightgray}
+% \0{magenta}
+% \0{olive}
+% \0{orange}
+% \0{pink}
+% \0{purple}
+% \0{red}
+% \0{violet}
+% \0{white}
+% \0{yellow}
+% \end{multicols}
+%
+%
+% \begin{multicols}{5}[\subsection{Colors via \Option{dvipsnames}}\label{sec.dvipsnam}]
+% \footnotesize\def\0#1{\Testclr{#1}{#1}}
+% \0{Apricot}
+% \0{Aquamarine}
+% \0{Bittersweet}
+% \0{Black}
+% \0{Blue}
+% \0{BlueGreen}
+% \0{BlueViolet}
+% \0{BrickRed}
+% \0{Brown}
+% \0{BurntOrange}
+% \0{CadetBlue}
+% \0{CarnationPink}
+% \0{Cerulean}
+% \0{CornflowerBlue}
+% \0{Cyan}
+% \0{Dandelion}
+% \0{DarkOrchid}
+% \0{Emerald}
+% \0{ForestGreen}
+% \0{Fuchsia}
+% \0{Goldenrod}
+% \0{Gray}
+% \0{Green}
+% \0{GreenYellow}
+% \0{JungleGreen}
+% \0{Lavender}
+% \0{LimeGreen}
+% \0{Magenta}
+% \0{Mahogany}
+% \0{Maroon}
+% \0{Melon}
+% \0{MidnightBlue}
+% \0{Mulberry}
+% \0{NavyBlue}
+% \0{OliveGreen}
+% \0{Orange}
+% \0{OrangeRed}
+% \0{Orchid}
+% \0{Peach}
+% \0{Periwinkle}
+% \0{PineGreen}
+% \0{Plum}
+% \0{ProcessBlue}
+% \0{Purple}
+% \0{RawSienna}
+% \0{Red}
+% \0{RedOrange}
+% \0{RedViolet}
+% \0{Rhodamine}
+% \0{RoyalBlue}
+% \0{RoyalPurple}
+% \0{RubineRed}
+% \0{Salmon}
+% \0{SeaGreen}
+% \0{Sepia}
+% \0{SkyBlue}
+% \0{SpringGreen}
+% \0{Tan}
+% \0{TealBlue}
+% \0{Thistle}
+% \0{Turquoise}
+% \0{Violet}
+% \0{VioletRed}
+% \0{White}
+% \0{WildStrawberry}
+% \0{Yellow}
+% \0{YellowGreen}
+% \0{YellowOrange}
+% \end{multicols}
+%
+%
+% \makeatletter
+% \def\ColorList#1#2#3#4{\begin{multicols}{#1}[\subsection{Colors via \Option{#2names}}\label{sec.#2nam}]
+% \footnotesize
+% \def\preparecolorset
+% {\def\XC@@cmd[####1]####2####3####4{\definecolor[####1]{@test}{####3}{####4}#4{@test}{####2}}\@testopt{\XC@definecolorset}{}}
+% \edef\restore{\catcode`\noexpand\%\the\catcode`\%\relax}
+% \catcode`\%14\relax\input{#3nam.def}\restore
+% \end{multicols}}
+% \makeatother
+%
+% \ColorList4{svg}{svg}\Testclr
+% \medskip
+% \begin{adjustwidth}{1cm}{1cm}
+% \footnotesize\raggedright Duplicate colors:
+% \Color[-]{Aqua} = \Color[-]{Cyan},
+% \Color[-]{Fuchsia} = \Color[-]{Magenta};
+% \Color[-]{Navy} = \Color[-]{NavyBlue};
+% \Color[-]{Gray} = \Color[-]{Grey},
+% \Color[-]{DarkGray} = \Color[-]{DarkGrey},
+% \Color[-]{LightGray} = \Color[-]{LightGrey},
+% \Color[-]{SlateGray} = \Color[-]{SlateGrey},
+% \Color[-]{DarkSlateGray} = \Color[-]{DarkSlateGrey},
+% \Color[-]{LightSlateGray} = \Color[-]{LightSlateGrey},
+% \Color[-]{DimGray} = \Color[-]{DimGrey}.
+% \par
+% Colors taken from \Index{Unix}/\Index{X11}:
+% \Color[-]{LightGoldenrod},
+% \Color[-]{LightSlateBlue},
+% \Color[-]{NavyBlue},
+% \Color[-]{VioletRed}.
+% \end{adjustwidth}
+%
+% \ColorList4{x11}{x11}\Testclr
+% \medskip
+% \begin{adjustwidth}{1cm}{1cm}
+% \footnotesize\raggedright Duplicate colors:
+% \Color[-]{Gray0} = \Color[-]{Grey0},
+% \Color[-]{Green0} = \Color[-]{Green1}.
+% \end{adjustwidth}
+%
% \end{adjustwidth}
%
%
@@ -1847,6 +2295,8 @@
% \Model{cmy}& $(0,0,0)$ & $(1,1,1)$ & $(\frac12,\frac12,\frac12)$ \\[2pt]
% \Model{cmyk}& $(0,0,0,0)$ & $(0,0,0,1)$ & $(0,0,0,\frac12)$ \\[2pt]
% \Model{hsb}& $(h,0,1)$ & $(h,0,0)$ & $(h,0,\frac12)$ \\[2pt]
+% \Model{Hsb}& $(h^\circ,0,1)$ & $(h^\circ,0,0)$ & $(h^\circ,0,\frac12)$ \\[2pt]
+% \Model{tHsb}& $(h^\circ,0,1)$ & $(h^\circ,0,0)$ & $(h^\circ,0,\frac12)$ \\[2pt]
% \Model{gray}& $1$ & $0$ & $\frac12$ \\[2pt]
% \Model{RGB}& $(L,L,L)$ & $(0,0,0)$ & $(\lfloor\frac {L+1}2\rfloor,\lfloor\frac {L+1}2\rfloor,\lfloor\frac {L+1}2\rfloor)$ \\[2pt]
% \Model{HTML}& \texttt{FFFFFF}& \texttt{000000}& \texttt{808080}\\[2pt]
@@ -1858,33 +2308,37 @@
%
%
% \begin{table}[p]\caption{Color conversion pairs}\label{tab.cnv}
-% \centering\small
+% \begin{adjustwidth}{-2.5cm}{}
+% \small\raggedleft
% \def\Em#1{\Model{#1}}
% \def\sp{\hbox to3em{\hfil$\ast$\hfil}}
% \def\id{\textrm{id}}
% \extrarowheight1pt
% \tabcolsep3pt
% \rowcolors{3}{tablerowcolor}{}
-% \begin{tabular}{c*9{>{\sffamily}c}}
+% \begin{tabular}{c*{11}{>{\sffamily}c}}
% \rowcolor{tableheadcolor}
% \hline
% \emph{from/to}&
-% \Em{rgb}& \Em{cmy}& \Em{cmyk}& \Em{hsb}& \Em{gray}& \Em{RGB}& \Em{HTML}& \Em{HSB}& \Em{Gray}\\
-% \Em{rgb}& \id & \sp & (cmy) & \sp & \sp & \sp & \sp & (hsb) & (gray)\\
-% \Em{cmy}& \sp & \id & \sp & (rgb) & \sp & (rgb) & (rgb) & (rgb) & (gray)\\
-% \Em{cmyk}& (cmy) & \sp & \id & (cmy) & \sp & (cmy) & (cmy) & (cmy) & (gray)\\
-% \Em{hsb}& \sp & (rgb) & (rgb) & \id & (rgb) & (rgb) & {rgb} & \sp & (rgb)\\
-% \Em{gray}& \sp & \sp & \sp & \sp & \id & \sp & \sp & \sp & \sp\\
-% \Em{RGB}& \sp & (rgb) & (rgb) & (rgb) & (rgb) & \id & (rgb) & (rgb) & (rgb)\\
-% \Em{HTML}& \sp & (rgb) & (rgb) & (rgb) & (rgb) & (rgb) & \id & (rgb) & (rgb)\\
-% \Em{HSB}& (hsb) & (hsb) & (hsb) & \sp & (hsb) & (hsb) & (hsb) & \id & (hsb)\\
-% \Em{Gray}& (gray) & (gray) & (gray) & (gray) & \sp & (gray) & (gray) & (gray) & \id\\
-% \Em{wave}& (hsb) & (hsb) & (hsb) & \sp & (hsb) & (hsb) & (hsb) & (hsb) & (hsb)\\
+% \Em{rgb}& \Em{cmy}& \Em{cmyk}& \Em{hsb}& \Em{Hsb} & \Em{tHsb} & \Em{gray}& \Em{RGB}& \Em{HTML}& \Em{HSB}& \Em{Gray}\\
+% \Em{rgb}& \id & \sp & (cmy) & \sp & (hsb) & (hsb) & \sp & \sp & \sp & (hsb) & (gray)\\
+% \Em{cmy}& \sp & \id & \sp & (rgb) & (rgb) & (rgb) & \sp & (rgb) & (rgb) & (rgb) & (gray)\\
+% \Em{cmyk}& (cmy) & \sp & \id & (cmy) & (cmy) & (cmy) & \sp & (cmy) & (cmy) & (cmy) & (gray)\\
+% \Em{hsb}& \sp & (rgb) & (rgb) & \id & \sp & (Hsb) & (rgb) & (rgb) & (rgb) & \sp & (rgb)\\
+% \Em{Hsb}& (hsb) & (hsb) & (hsb) & \sp & \id & \sp & (hsb) & (hsb) & (hsb) & (hsb) & (hsb)\\
+% \Em{tHsb}& (Hsb) & (Hsb) & (Hsb) & (Hsb) & \sp & \id & (Hsb) & (Hsb) & (Hsb) & (Hsb) & (Hsb)\\
+% \Em{gray}& \sp & \sp & \sp & \sp & \sp & \sp & \id & \sp & \sp & \sp & \sp\\
+% \Em{RGB}& \sp & (rgb) & (rgb) & (rgb) & (rgb) & (rgb) & (rgb) & \id & (rgb) & (rgb) & (rgb)\\
+% \Em{HTML}& \sp & (rgb) & (rgb) & (rgb) & (rgb) & (rgb) & (rgb) & (rgb) & \id & (rgb) & (rgb)\\
+% \Em{HSB}& (hsb) & (hsb) & (hsb) & \sp & (hsb) & (hsb) & (hsb) & (hsb) & (hsb) & \id & (hsb)\\
+% \Em{Gray}& (gray) & (gray) & (gray) & (gray) & (gray) & (gray) & \sp & (gray) & (gray) & (gray) & \id\\
+% \Em{wave}& (hsb) & (hsb) & (hsb) & \sp & (hsb) & (hsb) & (hsb) & (hsb) & (hsb) & (hsb) & (hsb)\\
% \hline\hline
-% \multicolumn{10}{c}{\id{} = identity function; $\ast$ = specific conversion function;}\\
-% \multicolumn{10}{c}{\textsf{(model)} = conversion via specified model}\\
+% \multicolumn{12}{c}{\id{} = identity function; $\ast$ = specific conversion function;}\\
+% \multicolumn{12}{c}{\textsf{(model)} = conversion via specified model}\\
% \hline
% \end{tabular}
+% \end{adjustwidth}
% \end{table}
%
%
@@ -2001,6 +2455,8 @@
% \begin{gather}
% E := (1,1,1)
% \end{gather}
+%
+%
% \subsubsection{The \Model{rgb} model}
%
% \paragraph{Conversion \Model{rgb} to \Model{cmy}}\label{sec.rgb2cmy}
@@ -2009,6 +2465,7 @@
% (\emph{cyan}, \emph{magenta}, \emph{yellow}) := E-(\emph{red}, \emph{green}, \emph{blue})
% \end{gather}
%
+%
% \paragraph{Conversion \Model{rgb} to \Model{hsb} (1)}
% We set
% \begin{align}
@@ -2061,6 +2518,7 @@
% Because we need to sort three numbers in order to calculate $x,y,z$, several comparisons are involved in the algorithm.
% We present now a second method which is more suited for \TeX.
%
+%
% \paragraph{Conversion \Model{rgb} to \Model{hsb} (2)}
% Let $\beta$ be a function that takes a Boolean expression as argument and returns 1 if the expression is true, 0 otherwise; set
% \begin{gather}
@@ -2105,27 +2563,29 @@
% Bold $i$~values mark the main cases where all $*$~values of a row are zero.
% The slight difference to equation (\ref{eq.rgb2hsb1}) in the last inequality is intentional and does no harm.
%
+%
% \paragraph{Conversion \Model{rgb} to \Model{gray}}
% Source: \cite{plrm}, p. 474.
% \begin{align}
% \emph{gray} & := 0.3\cdot\emph{red} + 0.59\cdot\emph{green} + 0.11\cdot\emph{blue}
% \end{align}
%
+%
% \paragraph{Conversion \Model{rgb} to \Model{RGB}}
% As described in section \vref{sec.real2int}.
-% \begin{align}
-% \emph{Red} & := \RtoI L(\emph{red})\\
-% \emph{Green} & := \RtoI L(\emph{green})\\
-% \emph{Blue} & := \RtoI L(\emph{blue})
-% \end{align}
+% \begin{gather}
+% (\emph{Red},\emph{Green},\emph{Blue}) := \bigl(\RtoI L(\emph{red}), \RtoI L(\emph{green}), \RtoI L(\emph{blue})\bigr)
+% \end{gather}
+%
%
% \paragraph{Conversion \Model{rgb} to \Model{HTML}}
-% As described in section \vref{sec.real2int}. Convert to hexadecimal afterwards.
-% \begin{align}
-% \emph{RR} & := \RtoI L(\emph{red})_{\emph{hex}}\\
-% \emph{GG} & := \RtoI L(\emph{green})_{\emph{hex}}\\
-% \emph{BB} & := \RtoI L(\emph{blue})_{\emph{hex}}
-% \end{align}
+% As described in section \vref{sec.real2int}.
+% Convert to 6-digit hexadecimal afterwards.
+% Certainly, multiplication and summation can be replaced by simple text concatenation of 2-digit hexadecimals.
+% \begin{gather}
+% \emph{RRGGBB} := \bigl( 65536\cdot\RtoI L(\emph{red}) + 256\cdot \RtoI L(\emph{green}) + \RtoI L(\emph{blue}) \bigr)_{\emph{hex}}
+% \end{gather}
+%
%
% \paragraph{Complement of \Model{rgb} color}
% We simply take the complementary vector:
@@ -2142,6 +2602,7 @@
% (\emph{red}, \emph{green}, \emph{blue}) := E - (\emph{cyan}, \emph{magenta}, \emph{yellow})
% \end{gather}
%
+%
% \paragraph{Conversion \Model{cmy} to \Model{cmyk}}\label{sec.cmy2cmyk}
% This is probably the hardest of our conversion tasks: many sources emphasize that there does not exist any universal conversion algorithm for this case because of device-dependence.
% The following algorithm is an extended version of the one given in \cite{plrm}, p. 476.
@@ -2168,12 +2629,14 @@
% \DescribeMacro\adjustUCRBG
% where the parameters are given by |\def\adjustUCRBG{|\Meta{$\beta_c$},\Meta{$\beta_m$},\Meta{$\beta_y$},\Meta{$\beta_k$}|}| at any point in a document, defaulting to |{|$\adjustUCRBG$|}|.
%
+%
% \paragraph{Conversion \Model{cmy} to \Model{gray}}
% This is derived from the conversion chain $\Model{cmy}\to\Model{rgb}\to\Model{gray}$.
% \begin{align}
% \emph{gray} & := 1 - (0.3\cdot\emph{cyan} + 0.59\cdot\emph{magenta} + 0.11\cdot\emph{yellow})
% \end{align}
%
+%
% \paragraph{Complement of \Model{cmy} color}
% We simply take the complementary vector:
% \begin{gather}
@@ -2191,12 +2654,14 @@
% \emph{yellow} & := \min\{1,\emph{yellow} + \emph{black}\}
% \end{align}
%
+%
% \paragraph{Conversion \Model{cmyk} to \Model{gray}}
% Source: \cite{plrm}, p. 475.
% \begin{align}
% \emph{gray} & := 1 - \min\{1,0.3\cdot\emph{cyan} + 0.59\cdot\emph{magenta} + 0.11\cdot\emph{yellow} + black\}
% \end{align}
%
+%
% \paragraph{Complement of \Model{cmyk} color}
% The simple vector complement does not yield useful results.
% Therefore, we first convert %$C=(\emph{cyan}, \emph{magenta}, \emph{yellow}, \emph{black})$
@@ -2251,13 +2716,18 @@
% A similar argument shows that $F$ indeed is a continuous function of \emph{hue} over the whole range $[0,1]$.
%
%
+% \paragraph{Conversion \Model{hsb} to \Model{Hsb}}
+% Only the first component has to be changed.
+% \begin{gather}
+% (\emph{hue\Circ}, \emph{saturation}, \emph{brightness}) := (H\cdot\emph{hue}, \emph{saturation}, \emph{brightness})
+% \end{gather}
+%
+%
% \paragraph{Conversion \Model{hsb} to \Model{HSB}}
-% As described in section \vref{sec.real2int}. Convert to hexadecimal afterwards.
-% \begin{align}
-% \emph{Hue} & := \RtoI M(\emph{hue})\\
-% \emph{Saturation} & := \RtoI M(\emph{saturation})\\
-% \emph{Brightness} & := \RtoI M(\emph{brightness})
-% \end{align}
+% As described in section \vref{sec.real2int}.
+% \begin{gather}
+% (\emph{Hue}, \emph{Saturation}, \emph{Brightness}) := \bigl(\RtoI M(\emph{hue}), \RtoI M(\emph{saturation}), \RtoI M(\emph{brightness})\bigr)
+% \end{gather}
%
%
% \paragraph{Complement of \Model{hsb} color}
@@ -2320,6 +2790,46 @@
% \end{proof}
%
%
+% \subsubsection{The \Model{Hsb} model}
+%
+% \paragraph{Conversion \Model{Hsb} to \Model{hsb}}
+% Only the first component has to be changed.
+% \begin{gather}
+% (\emph{hue}, \emph{saturation}, \emph{brightness}) := (\emph{hue\Circ}/H, \emph{saturation}, \emph{brightness})
+% \end{gather}
+%
+%
+% \paragraph{Conversion \Model{Hsb} to \Model{tHsb}}
+% Under the settings of (\ref{eq.tHsb1})--(\ref{eq.tHsb3}) we simply have to exchange the letters $x$ and $y$ in equation (\ref{eq.tHsb4}) to get the inverse transformation:
+% \begin{gather}
+% \displaystyle \emph{hue\Circ}\in\left[y_{\eta-1},y_\eta\right] \Rightarrow
+% \emph{hue\Circ} := x_{\eta-1} + \frac{x_\eta - x_{\eta-1}}{y_\eta - y_{\eta-1}}\cdot(\emph{hue\Circ} - y_{\eta-1})
+% \end{gather}
+% while \emph{saturation} and \emph{brightness} are left unchanged.
+%
+%
+% \subsubsection{The \Model{tHsb} model}
+%
+% \paragraph{Conversion \Model{tHsb} to \Model{Hsb}}\label{sec.tHsb2Hsb}
+% \DescribeMacro\rangeHsb
+% \DescribeMacro\rangetHsb
+% We assume that $\texttt{\string\rangeHsb}=H$ and |\rangetHsb| expands to
+% \begin{gather}
+% x_1,y_1;x_2,y_2;\dots;x_{h-1},y_{h-1}\label{eq.tHsb1}
+% \intertext{where}
+% x_0:=0<x_1<x_2<\dots<x_{h-1}<x_h:=H\label{eq.tHsb2}\\
+% y_0:=0<y_1<y_2<\dots<y_{h-1}<y_h:=H\label{eq.tHsb3}
+% \end{gather}
+% with an integer $h>0$.
+% Now the $x$ and $y$ values determine a piecewise linear transformation:
+% \begin{gather}
+% \displaystyle \emph{hue\Circ}\in\left[x_{\eta-1},x_\eta\right] \Rightarrow
+% \emph{hue\Circ} := y_{\eta-1} + \frac{y_\eta - y_{\eta-1}}{x_\eta - x_{\eta-1}}\cdot(\emph{hue\Circ} - x_{\eta-1})
+% \label{eq.tHsb4}
+% \end{gather}
+% while \emph{saturation} and \emph{brightness} are left unchanged.
+%
+%
% \subsubsection{The \Model{gray} model}
%
% \paragraph{Conversion \Model{gray} to \Model{rgb}}
@@ -2328,30 +2838,42 @@
% (\emph{red}, \emph{green}, \emph{blue}) := \emph{gray}\cdot E
% \end{gather}
%
+%
% \paragraph{Conversion \Model{gray} to \Model{cmy}}
% This is derived from the conversion chain $\Model{gray}\to\Model{rgb}\to\Model{cmy}$.
% \begin{gather}
% (\emph{cyan}, \emph{magenta}, \emph{yellow}) := (1-\emph{gray})\cdot E
% \end{gather}
%
+%
% \paragraph{Conversion \Model{gray} to \Model{cmyk}}
% Source: \cite{plrm}, p. 475.
% \begin{gather}
% (\emph{cyan}, \emph{magenta}, \emph{yellow}, \emph{black}) := (0,0,0,1-\emph{gray})
% \end{gather}
%
+%
% \paragraph{Conversion \Model{gray} to \Model{hsb}}
% This is derived from the conversion chain $\Model{gray}\to\Model{rgb}\to\Model{hsb}$.
% \begin{gather}
% (\emph{hue}, \emph{saturation}, \emph{brightness}) := (0,0,\emph{gray})
% \end{gather}
%
+%
+% \paragraph{Conversion \Model{gray} to \Model{Hsb}/\Model{tHsb}}
+% This is derived from the conversion chain $\Model{gray}\to\Model{hsb}\to\Model{Hsb}$, followed by $\Model{Hsb}\to\Model{tHsb}$ if applicable.
+% \begin{gather}
+% (\emph{hue\Circ}, \emph{saturation}, \emph{brightness}) := (0,0,\emph{gray})
+% \end{gather}
+%
+%
% \paragraph{Conversion \Model{gray} to \Model{Gray}}
% As described in section \vref{sec.real2int}.
% \begin{gather}
% \emph{Gray} := \RtoI N(\emph{gray})
% \end{gather}
%
+%
% \paragraph{Complement of \Model{gray} color}
% This is similar to the \Model{rgb} case:
% \begin{gather}
@@ -2431,6 +2953,7 @@
% We see no reason why we should not extend these edges in a similar fashion to end-up with true \Color{black} on either side.
% Now we are prepared to translate everything into another, more natural algorithm.
%
+%
% \paragraph{Conversion \Model{wave} to \Model{hsb}}
% Let $\lambda>0$ be a wavelength, given in nanometers (nm), and let
% \begin{gather}
@@ -2470,135 +2993,6 @@
% Thus, for the time being, \XC's implementation uses the latter value which implies a pure linear approach.
% In the \Package{pstricks} examples file \href{xcolor2.pdf}{\File{xcolor2.tex}}, there is a demonstration of different $\gamma$ values.
%
-%
-% \clearpage
-%
-% \begin{adjustwidth}{-2.5cm}{}
-% \raggedcolumns\columnsep2.5em
-%
-% \section{Colors by Name}\label{sec.names}
-%
-% \begin{multicols}{5}[\subsection{Base Colors}\label{sec.basenam}]
-% \footnotesize\def\0#1{\TestClr{#1}{#1}}
-% \0{black}
-% \0{blue}
-% \0{brown}
-% \0{cyan}
-% \0{darkgray}
-% \0{gray}
-% \0{green}
-% \0{lightgray}
-% \0{magenta}
-% \0{olive}
-% \0{orange}
-% \0{pink}
-% \0{purple}
-% \0{red}
-% \0{violet}
-% \0{white}
-% \0{yellow}
-% \end{multicols}
-%
-%
-% \begin{multicols}{5}[\subsection{Colors via \Option{dvipsnames}}\label{sec.dvipsnam}]
-% \footnotesize\def\0#1{\TestClr{#1}{#1}}
-% \0{Apricot}
-% \0{Aquamarine}
-% \0{Bittersweet}
-% \0{Black}
-% \0{Blue}
-% \0{BlueGreen}
-% \0{BlueViolet}
-% \0{BrickRed}
-% \0{Brown}
-% \0{BurntOrange}
-% \0{CadetBlue}
-% \0{CarnationPink}
-% \0{Cerulean}
-% \0{CornflowerBlue}
-% \0{Cyan}
-% \0{Dandelion}
-% \0{DarkOrchid}
-% \0{Emerald}
-% \0{ForestGreen}
-% \0{Fuchsia}
-% \0{Goldenrod}
-% \0{Gray}
-% \0{Green}
-% \0{GreenYellow}
-% \0{JungleGreen}
-% \0{Lavender}
-% \0{LimeGreen}
-% \0{Magenta}
-% \0{Mahogany}
-% \0{Maroon}
-% \0{Melon}
-% \0{MidnightBlue}
-% \0{Mulberry}
-% \0{NavyBlue}
-% \0{OliveGreen}
-% \0{Orange}
-% \0{OrangeRed}
-% \0{Orchid}
-% \0{Peach}
-% \0{Periwinkle}
-% \0{PineGreen}
-% \0{Plum}
-% \0{ProcessBlue}
-% \0{Purple}
-% \0{RawSienna}
-% \0{Red}
-% \0{RedOrange}
-% \0{RedViolet}
-% \0{Rhodamine}
-% \0{RoyalBlue}
-% \0{RoyalPurple}
-% \0{RubineRed}
-% \0{Salmon}
-% \0{SeaGreen}
-% \0{Sepia}
-% \0{SkyBlue}
-% \0{SpringGreen}
-% \0{Tan}
-% \0{TealBlue}
-% \0{Thistle}
-% \0{Turquoise}
-% \0{Violet}
-% \0{VioletRed}
-% \0{White}
-% \0{WildStrawberry}
-% \0{Yellow}
-% \0{YellowGreen}
-% \0{YellowOrange}
-% \end{multicols}
-%
-%
-% \makeatletter
-% \def\ColorList#1#2#3#4{\begin{multicols}{#1}[\subsection{Colors via \Option{#2names}}\label{sec.#2nam}]
-% \footnotesize
-% \def\preparecolorset
-% {\def\XC@@cmd[####1]####2####3####4{\definecolor[####1]{@test}{####3}{####4}#4{@test}{####2}}\@testopt{\XC@definecolorset}{}}
-% \edef\restore{\catcode`\noexpand\%\the\catcode`\%\relax}
-% \catcode`\%14\relax\input{#3nam.def}\restore
-% \end{multicols}}
-% \makeatother
-%
-% \ColorList4{svg}{svg}\TestClr
-% \medskip
-% \begin{adjustwidth}{1cm}{1cm}
-% \footnotesize\raggedright Duplicate colors:
-% \Color{Aqua} = \Color{Cyan},
-% \Color{Fuchsia} = \Color{Magenta};
-% \Color{Gray} = \Color{Grey},
-% \Color{DarkGray} = \Color{DarkGrey},
-% \Color{LightGray} = \Color{LightGrey},
-% \Color{SlateGray} = \Color{SlateGrey},
-% \Color{DarkSlateGray} = \Color{DarkSlateGrey},
-% \Color{LightSlateGray} = \Color{LightSlateGrey},
-% \Color{DimGray} = \Color{DimGrey}.
-% \end{adjustwidth}
-%
-% \end{adjustwidth}
% \clearpage
%
%
@@ -2612,33 +3006,41 @@
% {Adobe Systems Incorporated: ``PostScript Language Reference Manual''. Addison-Wesley, third edition, 1999.
% \URL{http://www.adobe.com/products/postscript/pdfs/PLRM.pdf}}
%
+% \bibitem{fbox}%
+% {\People{Donald}{Arseneau}: ``Patch so \cmd\fbox{} draws frame on top of text''. \LaTeX{} bug report, latex/3655, 2004/03/18.
+% \URL{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/3655}}
+%
+% \bibitem{url}%
+% {\People{Donald}{Arseneau}: \Package{url} package, ``2005/06/27 ver 3.2 Verb mode for urls, etc.''.
+% \CTAN{macros/latex/contrib/misc/}{url.sty}}
+%
% \bibitem{Bruton}%
-% {Dan~Bruton:~``Approximate RGB values for Visible Wavelengths'', 1996.
+% {\People{Dan}{Bruton}: ``Approximate RGB values for Visible Wavelengths'', 1996.
% \URL{http://www.physics.sfasu.edu/astro/color/spectra.html}}
%
% \bibitem{dpc}%
-% {David~P.~Carlisle:~``Packages in the `graphics' bundle'', 1999.
+% {\People{David P.}{Carlisle}: ``Packages in the `graphics' bundle'', 1999.
% \CTAN{macros/latex/required/graphics/}{grfguide.*}}
%
% \bibitem{color}%
-% {David~P.~Carlisle:~\LCP, ``1999/02/16 v1.0i Standard \LaTeX{} Color''.
+% {\People{David P.}{Carlisle}: \LCP, ``1999/02/16 v1.0i Standard \LaTeX{} Color''.
% \CTAN{macros/latex/required/graphics/}{color.*}}
%
% \bibitem{colortbl}%
-% {David~P.~Carlisle:~\Package{colortbl} package, ``2001/02/13 v0.1j Color table columns''.
+% {\People{David P.}{Carlisle}: \Package{colortbl} package, ``2001/02/13 v0.1j Color table columns''.
% \CTAN{macros/latex/contrib/carlisle/}{colortbl.*}}
%
% \bibitem{pstcol}%
-% {David~P.~Carlisle:~\Package{pstcol} package, ``2001/06/20 v1.1 PSTricks color compatibility''.
+% {\People{David P.}{Carlisle}: \Package{pstcol} package, ``2001/06/20 v1.1 PSTricks color compatibility''.
% \CTAN{macros/latex/required/graphics/}{pstcol.*}}
%
% \bibitem{chroma}%
-% {Uwe~Kern:~``Chroma: a reference book of \LaTeX{} colors''.
+% {\People{Uwe}{Kern}: ``Chroma: a reference book of \LaTeX{} colors''.
% \CTAN{info/colour/chroma/}{} and
% \URL{http://www.ukern.de/tex/chroma.html}}
%
% \bibitem{xcolor}%
-% {Uwe~Kern:~\Package{xcolor} package, ``\LaTeX{} color extensions''.
+% {\People{Uwe}{Kern}: \Package{xcolor} package, ``\LaTeX{} color extensions''.
% \CTAN{macros/latex/contrib/xcolor/}{} and
% \URL{http://www.ukern.de/tex/xcolor.html}}
%
@@ -2647,23 +3049,23 @@
% \URL{http://www.miktex.org/}}
%
% \bibitem{colorinfo}%
-% {Rolf~Niepraschk:~\Package{colorinfo} package, ``2003/05/04 v0.3c Info from defined colors''.
+% {\People{Rolf}{Niepraschk}: \Package{colorinfo} package, ``2003/05/04 v0.3c Info from defined colors''.
% \CTAN{macros/latex/contrib/colorinfo/}{}}
%
% \bibitem{pdfcolmk}%
-% {Heiko~Oberdiek:~\Package{pdfcolmk} package, ``2005/07/09 v0.7''.
+% {\People{Heiko}{Oberdiek}: \Package{pdfcolmk} package, ``2005/07/09 v0.7''.
% \CTAN{macros/latex/contrib/oberdiek/pdfcolmk.sty}{}}
%
% \bibitem{hyperref}%
-% {Sebastian~Rahtz:~\Package{hyperref} package, ``2003/11/30 v6.74m Hypertext links for \LaTeX''.
+% {\People{Sebastian}{Rahtz}: \Package{hyperref} package, ``2003/11/30 v6.74m Hypertext links for \LaTeX''.
% \CTAN{macros/latex/contrib/hyperref/}{}}
%
% \bibitem{smith}%
-% {Alvy Ray Smith: ``Color Gamut Transform Pairs''. \emph{Computer Graphics} (ACM SIGGRAPH), Volume 12, Number 3, August 1978.
+% {\People{Alvy Ray}{Smith}: ``Color Gamut Transform Pairs''. \emph{Computer Graphics} (ACM SIGGRAPH), Volume 12, Number 3, August 1978.
% \URL{http://alvyray.com/Papers/PapersCG.htm}}
%
% \bibitem{svg}%
-% {World Wide Web Consortium: ``Scalable Vector Graphics (SVG) 1.1 Specification --- Basic Data Types and Interfaces''.
+% {World Wide Web Consortium: ``Scalable Vector Graphics (\Index{SVG}) 1.1 Specification --- Basic Data Types and Interfaces''.
% \URL{http://www.w3.org/TR/SVG11/types.html\#ColorKeywords}}
%
% \end{thebibliography}
@@ -2676,9 +3078,9 @@
%
% \subsection*{Acknowledgement}
% \addcontentsline{toc}{subsection}{Acknowledgement}
-% This package is based on and contains code copied from \cite{color} (Copyright (C) 1994--1999 \People{David}{Carlisle}), which is part of the Standard \LaTeX{} `Graphics Bundle'.
+% This package is based on and contains code copied from \cite{color} (Copyright (C) 1994--1999 \People{David P.}{Carlisle}), which is part of the Standard \LaTeX{} `Graphics Bundle'.
% Although many commands and features have been added and most of the original \LC{} commands have been rewritten or adapted within \XC, the latter package would not exist without \LC.
-% Thus, the author is grateful to \People{David}{Carlisle} for having created \LC{} and its accompanying files.
+% Thus, the author is grateful to \People{David P.}{Carlisle} for having created \LC{} and its accompanying files.
%
% \subsection*{Trademarks}
% \addcontentsline{toc}{subsection}{Trademarks}
@@ -2699,12 +3101,68 @@
% \subsection*{History}
% \addcontentsline{toc}{subsection}{History}
%
+% \subsubsection*{2005/12/21 v2.09}
+% \begin{itemize}
+% \item New features:
+% \begin{itemize}
+% \item |\definecolor| and |\color| now accept space-separated color specifications, e.g., |\color| |[rgb]{1 .5 0}|;
+% \item experimental \Option{xcdraw} option extended to \Option{pdftex} and \Option{dvipdfm} drivers.
+% \end{itemize}
+% \item Changes:
+% \begin{itemize}
+% \item test file \File{xcolor2.tex} made compatible with recent changes in \Package{pstricks};
+% \item test file \File{xcolor3.tex} extended;
+% \item driver test file \File{xcolor4.tex} extended to demonstrate the different frame drawing approaches;
+% \item more efficient implementation of driver-specific code.
+% \end{itemize}
+% \end{itemize}
+%
+% \subsubsection*{2005/11/25 v2.08}
+% \begin{itemize}
+% \item New features:
+% \begin{itemize}
+% \item more flexibility for |\fcolorbox| arguments, e.g., |\fcolorbox| |[gray]{0.5}[wave]{580}{test}|;
+% \item |\boxframe| returns a frame of given dimensions;
+% \item new implementation of |\f(rame)box| and |\fcolorbox| as an extension of bug report latex/3655 to reduce pixel positioning errors in output devices;
+% \item \Option{kernelfbox} option for those who prefer the previous |\f(rame)box| approach;
+% \item experimental \Option{xcdraw} option uses \Index{PostScript} commands to draw frames and color boxes in case of \Option{dvips}.
+% \end{itemize}
+% \item Bugfixes:
+% \begin{itemize}
+% \item insufficient expression type detection within |\colorlet|;
+% \item wrong calculation in the unit interval reduction for negative integers (affecting color series and extended color expressions).
+% \end{itemize}
+% \end{itemize}
+%
+% \subsubsection*{2005/11/12 v2.07}
+% \begin{itemize}
+% \item New features:
+% \begin{itemize}
+% \item color model \Model{Hsb} allows to specify \emph{hue} in degrees;
+% \item color model \Model{tHsb} (\pModel{tuned} \Model{Hsb}) for user-defined \emph{hue} configuration on color wheels;
+% \item easy generation of color harmonies derived from \Model{Hsb} or \Model{tHsb} color wheels, e.g., |\color{red>wheel,1,12}| yields an `analogous' color to \Color{red} on a 12-spoke wheel;
+% \item additional 317 predefined color names according to \File{rgb.txt}, which is part of \Index{Unix}/\Index{X11} distributions;
+% \item \Option{svgnames} option extended by~4~colors taken from \File{rgb.txt};
+% \item enhanced syntax for immediate conversion, e.g., |\definecolor| |{foo}{rgb:gray}{0.3}| or |\color| |[rgb:wave]{478}|;
+% \item |\@ifundefinedcolor| and |\@ifundefinedmodel| commands;
+% \end{itemize}
+% \item Changes:
+% \begin{itemize}
+% \item enhanced documentation;
+% \item several changes to internal macros.
+% \end{itemize}
+% \item Bugfixes:
+% \begin{itemize}
+% \item wrong calculation of color series components in some cases of negative step parameters.
+% \end{itemize}
+% \end{itemize}
+%
% \subsubsection*{2005/10/15 v2.06}
% \begin{itemize}
% \item New features:
% \begin{itemize}
% \item color model \Model{wave} for (approximate) visualisation of light wavelengths, still somewhat experimental;
-% \item pseudo-model \nModel{ps} for colors defined by literal PostScript code in conjunction with \Package{pstricks} and \Option{dvips}; an illustrative example for a $\gamma$-correction approach is given in \href{xcolor2.pdf}{\File{xcolor2.tex}};
+% \item pseudo-model \nModel{ps} for colors defined by literal \Index{PostScript} code in conjunction with \Package{pstricks} and \Option{dvips}; an illustrative example for a $\gamma$-correction approach is given in \href{xcolor2.pdf}{\File{xcolor2.tex}};
% \item |\substitutecolormodel| command for replacement of missing or faulty driver-specific color models;
% \item improved detection and handling of driver-specific color models;
% \item \Option{dvipdfmx} and \Option{xetex} options to support these drivers;
@@ -2740,7 +3198,7 @@
% \item Changes:
% \begin{itemize}
% \item color model names sanitized (i.e., turned to catcode~12) throughout the package;
-% \item |\@namelet| command deprecated because of name clash with \Package{memoir} -- please use |\XC@let@cc| instead (more |\XC@let@..| commands are available as well);
+% \item |\@namelet| command deprecated because of name clash with \Package{memoir} --- please use |\XC@let@cc| instead (more |\XC@let@..| commands are available as well);
% \item simplified color conversion code by using the new |\XC@ifxcase| command;
% \item some minor changes to internal macros.
% \end{itemize}
@@ -2986,7 +3444,7 @@
%
% \section{The Implementation}
%
-% Some commands have been copied unchanged from \cite{color} (Copyright (C) 1994--1999 \People{David}{Carlisle}), which is part of the Standard \LaTeX{} `Graphics Bundle'.
+% Some commands have been copied unchanged from \cite{color} (Copyright (C) 1994--1999 \People{David P.}{Carlisle}), which is part of the Standard \LaTeX{} `Graphics Bundle'.
% Additionally, also some parts of the code documentation were copied from \cite{color}.
%
%
@@ -3023,6 +3481,7 @@
\catcode`\noexpand\;\the\catcode`\;\relax
\catcode`\noexpand\/\the\catcode`\/\relax
\catcode`\noexpand\"\the\catcode`\"\relax
+ \catcode`\noexpand\>\the\catcode`\>\relax
\catcode`\noexpand\^^A\the\catcode`\^^A\relax}
% \end{macrocode}
% \end{macro}
@@ -3036,6 +3495,7 @@
\catcode`\;=12
\catcode`\/=12
\catcode`\"=12
+\catcode`\>=12
\catcode`\^^A=\catcode`\%
% \end{macrocode}
%
@@ -3100,11 +3560,11 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\ifXC@@xcp}
+% \begin{macro}{\ifXC@@fbox}
% \begin{macro}{\ifXC@@tst}
% Auxiliary test variables.
% \begin{macrocode}
-\newif\ifXC@@xcp
+\newif\ifXC@@fbox \XC@@fboxtrue
\newif\ifXC@@tst
% \end{macrocode}
% \end{macro}
@@ -3148,16 +3608,14 @@
% \marg{target character string}\marg{source character string}\\
% Performs |\let\|\Meta{target character string}|=\|\Meta{source character string}.
% \begin{macrocode}
-\def\XC@let@cc#1%
- {\expandafter\XC@let@Nc\csname#1\endcsname}
+\def\XC@let@cc#1{\expandafter\XC@let@Nc\csname#1\endcsname}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@namelet}
% This is provided for compatibility reasons only, although deprecated because of a name clash with \Package{memoir}.
% \begin{macrocode}
-\providecommand*\@namelet[1]%
- {\expandafter\XC@let@Nc\csname#1\endcsname}
+\providecommand*\@namelet[1]{\expandafter\XC@let@Nc\csname#1\endcsname}
% \end{macrocode}
% \end{macro}
%
@@ -3166,8 +3624,7 @@
% Performs |\let|\Meta{target name}|=\|\Meta{source character string}.
% Formerly called |\@@namelet|.
% \begin{macrocode}
-\def\XC@let@Nc#1#2%
- {\expandafter\let\expandafter#1\csname#2\endcsname}
+\def\XC@let@Nc#1#2{\expandafter\let\expandafter#1\csname#2\endcsname}
% \end{macrocode}
% \end{macro}
%
@@ -3175,8 +3632,7 @@
% \marg{target character string}\marg{source name}\\
% Performs |\let\|\Meta{target character string}|=|\Meta{source name}.
% \begin{macrocode}
-\def\XC@let@cN#1%
- {\expandafter\let\csname#1\endcsname}
+\def\XC@let@cN#1{\expandafter\let\csname#1\endcsname}
% \end{macrocode}
% \end{macro}
%
@@ -3197,7 +3653,7 @@
\def\aftergroupdef#1#2%
{\expandafter\endgroup\expandafter\def\expandafter#1\expandafter{#2}}
\def\aftergroupedef#1#2%
- {\edef\@@tmp{\noexpand\def\noexpand#1{#2}}\expandafter\endgroup\@@tmp}
+ {\edef\@@tmp{\def\noexpand#1{#2}}\expandafter\endgroup\@@tmp}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -3207,13 +3663,13 @@
% \begin{macro}{\XC@sdef}
% \marg{cmd}\marg{code}\\
% Defines \Meta{cmd} as a safe expansion of \Meta{code}; needed for color expressions in certain languages.
-% The second form is a streamlined version that takes only care of active `|/|' characters that may occur in \Meta{model-list} and \Meta{spec-list} arguments.
+% The second form is a streamlined version that takes only care of active `|/|' and `|:|' characters that may occur in \Meta{model-list} and \Meta{spec-list} arguments.
% The third form defines a sanitized expansion without considering active characters.
% It is faster since it needs no grouping operation.
% \begin{macrocode}
\begingroup
\catcode`\!=13 \catcode`\:=13 \catcode`\-=13 \catcode`\+=13
-\catcode`\;=13 \catcode`\/=13 \catcode`\"=13
+\catcode`\;=13 \catcode`\/=13 \catcode`\"=13 \catcode`\>=13
\gdef\XC@edef#1#2%
{\begingroup
\ifnum\catcode`\!=13 \edef!{\string!}\fi
@@ -3222,10 +3678,12 @@
\ifnum\catcode`\+=13 \edef+{\string+}\fi
\ifnum\catcode`\;=13 \edef;{\string;}\fi
\ifnum\catcode`\"=13 \edef"{\string"}\fi
+ \ifnum\catcode`\>=13 \edef>{\string>}\fi
\edef#1{#2}\@onelevel@sanitize#1\aftergroupdef#1#1}
\gdef\XC@mdef#1#2%
{\begingroup
\ifnum\catcode`\/=13 \edef/{\string/}\fi
+ \ifnum\catcode`\:=13 \edef:{\string:}\fi
\edef#1{#2}\@onelevel@sanitize#1\aftergroupdef#1#1}
\endgroup
\def\XC@sdef#1#2{\edef#1{#2}\@onelevel@sanitize#1}
@@ -3235,6 +3693,50 @@
% \end{macro}
%
%
+% \subsubsection{Conditional processing}
+%
+% \begin{macro}{\@ifxempty}
+% \marg{arg}\marg{empty}\marg{non-empty}\\
+% Tests without expanding, whether the argument \Meta{arg} is empty and executes the following code accordingly; \Meta{arg} must not start with the token |\XC@@|.
+% Can also be used within |\edef|.
+% \begin{macrocode}
+\def\@ifxempty#1{\@@ifxempty#1\@@ifxempty\XC@@}
+\def\@@ifxempty#1#2\XC@@
+ {\ifx#1\@@ifxempty
+ \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@ifxcase}
+% \marg{cmd}|{{|\Meta[1]{cmd}|}{|\Meta[1]{code}|}...{|\Meta[n]{cmd}|}{|\Meta[n]{code}|}}|\marg{default code}\\
+% Performs the test |\ifx|\Meta{cmd}\Meta[k]{cmd} for $k=1,\dots,n$.
+% If for some $k$ the test is `true', then the attached code \Meta[k]{code} is executed.
+% If all tests are `false', then \Meta{default code} is executed.
+% \begin{macrocode}
+\long\def\XC@ifxcase#1#2#3%
+ {\long\def\@@tmp##1##2%
+ {\ifx#1##1%
+ \toks@{##2}\expandafter\remove@to@nnil\else\expandafter\@@tmp\fi}%
+ \@@tmp#2#1{#3}\@nnil\the\toks@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@ifcase}
+% \marg{str}|{{|\Meta[1]{str-list}|}{|\Meta[1]{code}|}...{|\Meta[n]{str-list}|}{|\Meta[n]{code}|}}|\marg{default code}\\
+% Tests whether \Meta{str} appears in one of the comma-separated lists \Meta[k]{str-list}.
+% Performs the test |\if|\Meta{str}\Meta[kl]{str} for $k=1,\dots,n$ and $l=1,\ldots,m_n$.
+% If for some $k,l$ the test is `true', then the attached code \Meta[k]{code} is executed.
+% If all tests are `false', then \Meta{default code} is executed.
+% \begin{macrocode}
+\long\def\XC@ifcase#1#2#3%
+ {\long\def\@@tmp##1##2%
+ {\@expandtwoargs\in@{,#1,}{,##1,}\ifin@
+ \toks@{##2}\expandafter\remove@to@nnil\else\expandafter\@@tmp\fi}%
+ \@@tmp#2{#1}{#3}\@nnil\the\toks@}
+% \end{macrocode}
+% \end{macro}
+%
+%
%
% \subsection{Package options}
%
@@ -3292,6 +3794,8 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\XC@mod@Hsb}
+% \begin{macro}{\XC@mod@tHsb}
% \begin{macro}{\XC@mod@ignore}
% \begin{macro}{\XC@mod@named}
% \begin{macro}{\XC@mod@ps}
@@ -3309,7 +3813,7 @@
% Put model names into commands and define package options
% \Option{natural}, \Option{rgb}, \Option{cmy}, \Option{cmyk}, \Option{hsb}, \Option{gray}, \Option{RGB}, \Option{HTML}, \Option{HSB}, \Option{Gray}.
% \begin{macrocode}
-\@tfor\@@tmp:={ignore}{named}{ps}{wave}\do
+\@tfor\@@tmp:={Hsb}{tHsb}{ignore}{named}{ps}{wave}\do
{\expandafter\XC@sdef\csname XC@mod@\@@tmp\endcsname{\@@tmp}}
% \end{macrocode}
%
@@ -3334,6 +3838,8 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% The \Option{monochrome} option should be used \emph{in addition} to one of the standard driver options.
% \begin{macrocode}
@@ -3385,6 +3891,7 @@
% \begin{macrocode}
\XC@declarenames{dvipsnames}{dvipsnam}{\let\colornameprefix\@empty}
\XC@declarenames{svgnames}{svgnam}{}
+\XC@declarenames{x11names}{x11nam}{}
\XC@declarenames{hksnames}%
{hks\ifcase\paperquality k\or n\or k\or z\else n\fi nam}{}
\XC@declarenames{pmsnames}{pmsnam}{}
@@ -3394,7 +3901,7 @@
%
% \subsubsection{Support for other packages}
%
-% Use this option to load \People{David}{Carlisle}'s \Package{colortbl} package:
+% Use this option to load \People{David P.}{Carlisle}'s \Package{colortbl} package:
% \begin{macrocode}
\DeclareOption{table}{\XC@append\XC@@pkg{\RequirePackage{colortbl}}}
% \end{macrocode}
@@ -3404,7 +3911,7 @@
\DeclareOption{fixpdftex}{\XC@append\XC@@pkg{\RequirePackage{pdfcolmk}}}
% \end{macrocode}
%
-% Use this option to load \People{David}{Carlisle}'s \Package{pstcol} package in order to make standard color definitions available within \Package{pstricks}.
+% Use this option to load \People{David P.}{Carlisle}'s \Package{pstcol} package in order to make standard color definitions available within \Package{pstricks}.
% Warning: this option is neither needed nor useful with recent \Package{pstricks} versions.
% \begin{macrocode}
\DeclareOption{pst}{\def\XC@pst{\RequirePackage{pstcol}}}
@@ -3456,7 +3963,7 @@
{emtex}{pctex32}{pctexhp}{pctexps}{pctexwin}{pdftex}%
{tcidvi}{textures}{truetex}{vtex}{xetex}\do
{\edef\@@tmp{\noexpand\DeclareOption{\@@tmp}%
- {\noexpand\def\noexpand\Gin@driver{\@@tmp.def}}}%
+ {\def\noexpand\Gin@driver{\@@tmp.def}}}%
\@@tmp}
% \end{macrocode}
%
@@ -3467,15 +3974,22 @@
\DeclareOption{xdvi}{\ExecuteOptions{dvips,monochrome}}
% \end{macrocode}
%
-% \Option{prologue} option, used by (some) drivers.
+% Options used by (some) drivers.
% \begin{macrocode}
-\DeclareOption{prologue}{\XC@@xcptrue}
+\DeclareOption{xcdraw}{\def\XC@@xcd@{1}}
+\DeclareOption{noxcdraw}{\def\XC@@xcd@{-1}}
+\DeclareOption{prologue}{\def\XC@@xcp@{1}}
% \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Other options}
%
+% Switch to original kernel |\fbox| command instead of new \XC{} version.
+% \begin{macrocode}
+\DeclareOption{kernelfbox}{\XC@@fboxfalse}
+% \end{macrocode}
+%
% These options control how non-existing colors are treated:
% \begin{macrocode}
\DeclareOption{showerrors}{\colorerrors@true}
@@ -3495,6 +4009,8 @@
%
% Choose default options:
% \begin{macrocode}
+\def\XC@@xcd@{-1}
+\def\XC@@xcp@{-1}
\ExecuteOptions{natural,showerrors}
% \end{macrocode}
%
@@ -3533,28 +4049,59 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\XC@@drv@}
-% Test variable for |\ifcase| expressions.
+% \begin{macro}{\XC@@xcd@}
+% \begin{macro}{\XC@@xcp@}
+% These are used firstly by the \Option{xcdraw} and \Option{prologue} options, indicating whether either option is swithed on or off.
+% Secondly, the macros serve as test variables for |\ifcase| expressions, storing the intended type of output: $-1=\text{dvi}, 0=\text{ps}, 1=\text{pdf}$.
+% \begin{macrocode}
+\count@\XC@@xcd@ \advance\count@\XC@@xcp@\relax
+\ifnum\count@>-2
+% \end{macrocode}
+%
+% \begin{macro}{\XC@special}
+% \meta{code}\\
+% Driver-specific variant of |\special|.
+% Even if the intended type of output is the same (e.g., pdf), the |\special| commands may differ.
% \begin{macrocode}
-\def\XC@@drv@{-1}
-\@tfor\@@tmp:={dvips}{pctex32}\do
- {\ifx\@@tmp\XC@@drv\def\XC@@drv@{0}\@break@tfor\fi}
+ \XC@ifcase\XC@@drv
+ {{dvips,pctex32}%
+ {\def\@tempa{0}
+ \def\XC@special#1{\special{ps:XC!b}\special{"#1}\special{ps:XC!e}}}%
+ {pdftex}%
+ {\def\@tempa{1}
+ \def\XC@special#1{\pdfliteral{ q #1 Q }}}%
+ {dvipdfm}%
+ {\def\@tempa{1}
+ \def\XC@special#1{\special{pdf: content #1}}}%
+ }{\def\@tempa{-1}}
+% \end{macrocode}
+%
+% Since the options are independent of each other, we have to adjust the affiliated test variables independently as well.
+% \begin{macrocode}
+ \ifnum\XC@@xcd@>\m@ne\let\XC@@xcd@\@tempa\fi
+ \ifnum\XC@@xcp@>\m@ne\let\XC@@xcp@\@tempa\fi
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\XC@@xcp}
-% File variabe for prologue output.
+% File variable for prologue output.
+% \begin{macrocode}
+ \ifnum\@tempa=0 \AtBeginDvi{\special{header=xcolor.pro}}\fi
+ \ifcase\XC@@xcp@
+ \AtBeginDvi{\special{header=\jobname.xcp}}
+ \newwrite\XC@@xcp\immediate\openout\XC@@xcp=\jobname.xcp
+ \immediate\write\XC@@xcp{\@percentchar!}
+ \immediate\write\XC@@xcp{TeXDict begin}
+ \AtEndDocument
+ {\immediate\write\XC@@xcp{end}\immediate\closeout\XC@@xcp}
+ \fi
+% \end{macrocode}
+%
+% End of driver-specific part.
% \begin{macrocode}
-\ifXC@@xcp\ifcase\XC@@drv@
- \AtBeginDvi{\special{header=xcolor.pro}\special{header=\jobname.xcp}}
- \newwrite\XC@@xcp\immediate\openout\XC@@xcp=\jobname.xcp
- \immediate\write\XC@@xcp{\@percentchar!}
- \immediate\write\XC@@xcp{TeXDict begin}
- \AtEndDocument
- {\immediate\write\XC@@xcp{end}\immediate\closeout\XC@@xcp}
-\fi\fi
+\fi
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
%
% \subsubsection{Required packages}
@@ -3581,36 +4128,6 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@ifxempty}
-% \marg{arg}\marg{empty}\marg{non-empty}\\
-% Tests without expanding, whether the argument \Meta{arg} is empty and executes the following code accordingly; \Meta{arg} must not start with the token |\XC@@|.
-% Can also be used within |\edef|.
-% \begin{macrocode}
-\def\@ifxempty#1{\@@ifxempty#1\@@ifxempty\XC@@}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\def\@@ifxempty#1#2\XC@@
- {\ifx#1\@@ifxempty
- \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\XC@ifxcase}
-% \marg{cmd}|{{|\Meta[1]{cmd}|}{|\Meta[1]{code}|}...{|\Meta[n]{cmd}|}{|\Meta[n]{code}|}}|\marg{default code}\\
-% Performs the test |\ifx|\Meta{cmd}\Meta[k]{cmd} for $k=1,\dots,n$.
-% If for some $k$ the test is `true', then the attached code \Meta[k]{code} is executed.
-% If all tests are `false', then \Meta{default code} is executed.
-% \begin{macrocode}
-\long\def\XC@ifxcase#1#2#3%
- {\long\def\XC@ifxc@se##1##2%
- {\ifx#1##1%
- \toks@{##2}\expandafter\remove@to@nnil\else
- \expandafter\XC@ifxc@se\fi}%
- \XC@ifxc@se#2#1{#3}\@nnil\the\toks@}
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\xglobal}
% \begin{macro}{\xglobal@test}
% If |\foo| occurs in the token list |\xglobal@@|, then the command |\xglobal\foo| will set the switch |\xglobal@true| which can be used inside |\foo| to determine whether certain definitions are to be made explicitely global.
@@ -3678,9 +4195,6 @@
% May be used inside |\edef|.
% \begin{macrocode}
\def\@hex@Hex#1{\ifx#1\relax\else\expandafter\@hex@@Hex\expandafter#1\fi}
-% \end{macrocode}
-%
-% \begin{macrocode}
\def\@hex@@Hex#1%
{\if a#1A\else \if b#1B\else \if c#1C\else \if d#1D\else
\if e#1E\else \if f#1f\else #1\fi\fi\fi\fi\fi\fi \@hex@Hex}
@@ -3701,6 +4215,50 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\XC@replace}
+% \marg{cmd}\marg{search}\marg{replace}\\
+% Replace all occurences of \meta{search} within the first-level expansion of \meta{cmd} by \meta{replace} and save the result in \meta{cmd}.
+% The replacement is recursive, so don't put the search pattern into the replacement text!
+% Note that this macro is incapable of seeing `into' braces.
+% The code and its explanation is taken from \People{Donald}{Arseneau}'s \Package{url} package \cite{url}, with only minor changes and renamings applied.
+% The original name of the game is |\Url@Edit|.
+% Thanks to \People{Donald}{Arseneau} for giving me valuable hints.
+% \begin{macrocode}
+{\catcode`Q=3
+ \gdef\XC@replace#1#2#3%
+ {\begingroup
+% \end{macrocode}
+%
+% If finished, then remove |\@empty|'s and redefine macro else, re-iterate.
+% \begin{macrocode}
+ \def\XC@repl@ce##1#2##2Q##3%
+ {\@ifxempty{##2}{\XC@r@pl@ce##1Q}{\XC@repl@ce##1##3##2Q{##3}}}%
+ \def\XC@r@pl@ce##1\@empty Q%
+ {\expandafter\endgroup\expandafter\def\expandafter#1\expandafter{##1}}%
+% \end{macrocode}
+%
+% The leading |\@empty| preserves braces, as does the trailing pattern.
+% \begin{macrocode}
+ \expandafter\XC@repl@ce\expandafter\@empty #1\@empty#2Q{#3}}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@clean}
+% \marg{cmd}\\
+% Makes a proper comma-separated list from \meta{cmd}'s contents and stores it again in \meta{cmd}.
+% Firstly, all commas are changed into spaces, secondly, spaces are turned into commas (using a technique similar to \LaTeX's |\zap@space|).
+% Thirdly, the two leading commas are gobbled.
+% For example, `| 1 2 , 3 |' is mapped to `|1,2,3|'.
+% \begin{macrocode}
+\def\XC@clean#1%
+ {\edef#1{ #1 }\edef#1{\expandafter\XC@strip@comma#1,,\@nnil}%
+ \edef#1{\expandafter\XC@cle@n#1\@empty}%
+ \edef#1{\expandafter\@gobbletwo#1}}
+\def\XC@cle@n#1 #2{,#1\ifx#2\@empty\else\expandafter\XC@cle@n\fi#2}
+% \end{macrocode}
+% \end{macro}
+%
%
% \subsubsection{Scalar arithmetic}
%
@@ -3952,8 +4510,16 @@
% \textbf Division of $x$ by $s$: performs |\def|\Meta{cmd}|{|$x/s$|}|.
% The parameter $s$ is input via |\@@scl|.
% \begin{macrocode}
-\def\XC@calcD#1#2%
- {\dimen@#1\p@ \rdivide\dimen@\@@scl \edef#2{\strip@pt\dimen@}}
+\def\XC@calcD{\XC@c@lcD\@@scl{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@c@lcD}
+% \marg{s}\marg{string}\marg{x}\marg{cmd}\\
+% \textbf Division of $x$ by $s$, appending \Meta{string}: performs |\def|\Meta{cmd}|{|$x/s$\Meta{string}|}|.
+% \begin{macrocode}
+\def\XC@c@lcD#1#2#3#4%
+ {\dimen@#3\p@ \rdivide\dimen@{#1}\edef#4{\strip@pt\dimen@#2}}
% \end{macrocode}
% \end{macro}
%
@@ -4039,9 +4605,20 @@
% \textbf Scaling of $x$ by $s$: performs |\def|\Meta{cmd}|{|$s\cdot x$|}|.
% The parameter $s$ is input via |\@@scl|.
% \begin{macrocode}
-\def\XC@calcS#1#2%
- {\lshiftset\dimen@{#1}\dimen@\lshiftnum\@@scl\dimen@ \rrshift\dimen@
- \edef#2{\strip@pt\dimen@}}
+\def\XC@calcS{\XC@c@lcS\@@scl{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@c@lcS}
+% \marg{s}\marg{string}\marg{x}\marg{cmd}\\
+% \textbf Scaling of $x$ by $s$, appending \Meta{string}: performs |\def|\Meta{cmd}|{|$s\cdot x$\Meta{string}|}|.
+% \begin{macrocode}
+\def\XC@c@lcS#1#2#3#4%
+ {\lshiftset\dimen@{#3}%
+ \ifdim#1\p@<100\p@
+ \dimen@\lshiftnum#1\dimen@ \rrshift\dimen@ \else
+ \dimen@#1\dimen@ \rshift\dimen@ \fi
+ \edef#4{\strip@pt\dimen@#2}}
% \end{macrocode}
% \end{macro}
%
@@ -4065,8 +4642,8 @@
{\dimen@#1\p@
\ifdim\dimen@=\p@\else
\afterassignment\dimen@\count@=\the\dimen@
- \ifnum\count@<\z@
- \lshift\dimen@ \dimen@-\dimen@ \advance\dimen@10\p@ \rshift\dimen@
+ \relax\ifdim\dimen@=\z@\else
+ \ifdim#1\p@<\z@ \dimen@-\dimen@ \advance\dimen@\p@ \fi
\fi
\fi
\edef#2{\strip@pt\dimen@}}
@@ -4080,16 +4657,22 @@
%
% \begin{macro}{\rangeRGB}
% \begin{macro}{\rangeHSB}
+% \begin{macro}{\rangeHsb}
+% \begin{macro}{\rangetHsb}
% \begin{macro}{\rangeGray}
-% Scaling ranges for `integer models':
+% Scaling ranges for `integer' and other special models:
% \begin{macrocode}
\providecommand*\rangeRGB{255}
\providecommand*\rangeHSB{240}
+\providecommand*\rangeHsb{360}
+\providecommand*\rangetHsb{60,30;120,60;180,120;210,180;240,240}
\providecommand*\rangeGray{15}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\adjustUCRBG}
% Parameters for undercolor-removal (UCR) and black-generation (BG) during \Model{cmy} to \Model{cmyk} conversion:
@@ -4141,12 +4724,12 @@
% \begin{macro}{\definecolor}
% \oarg{type}\marg{name}\oarg{prefix}\marg{model-list}\marg{spec-list}\\
% Extends the facilities of \LC's |\definecolor|.
-% The optional argument \Meta{type} has currently to be either empty (= normal color definition) or `named'.
+% The optional argument \Meta{type} has currently to be either empty (= normal color definition) or `named' or `ps'.
% \Meta{prefix} is an argument used for the internal driver-dependent representation.
% |\definecolor| creates a new command |\\color@|\Meta{name} that contains the \emph{internal representation}
% |\xcolor@|\marg{type-spec}\marg{driver-spec}\marg{n-model}\marg{n-color-spec} of the color, where
% \begin{itemize}
-% \item \Meta{type-spec} is either empty (if \Meta{type} was empty), or a driver-dependent macro or expression (if \Meta{type} was `named');
+% \item \Meta{type-spec} is either empty (if \Meta{type} was empty), or a driver-dependent macro or expression (if \Meta{type} was `named', `ps');
% \item \Meta{driver-spec} is a driver-dependent representation of the color, which also depends on \Meta{type};
% \item \Meta{n-model} is either \Meta{model} or the name of another color model, dependent on the desired transformation(s) at definition time;
% \item \Meta{n-color-spec} are the comma-separated normalised parameter values of the color with respect to \Meta{n-model}.
@@ -4154,9 +4737,6 @@
% See table \vref{tab.internal} for some examples.
% \begin{macrocode}
\def\definecolor{\@testopt{\XC@definecolor}{}}
-% \end{macrocode}
-%
-% \begin{macrocode}
\def\XC@definecolor[#1]#2%
{\@testopt{\XC@definec@lor[#1]{#2}}\colornameprefix}
% \end{macrocode}
@@ -4166,10 +4746,7 @@
{\begingroup
\XC@sdef\@@cls{#1}\XC@edef\@@nam{#2}\edef\colornameprefix{#3}%
\XC@logdef\@@nam
- \ifXC@@getmod\XC@getmod{#4}\XC@@pos\@@mod\fi
- \XC@getclr{#5}\XC@@pos\@@clr
- \@ifundefined{color@\@@mod}%
- {\c@lor@error{model `\@@mod'}\let\@@tmp\relax}%
+ \XC@getmodclr02{#4}{#5}{\let\@@tmp\relax}%
{\ifx\@@mod\XC@mod@named
\XC@c@l@rlet\@@nam\@@clr
\else
@@ -4192,11 +4769,11 @@
%
% Handle prologue and `named' colors:
% \begin{macrocode}
- \ifXC@@xcp\ifcase\XC@@drv@
+ \ifcase\XC@@xcp@
\immediate\write\XC@@xcp{/\colornameprefix\@@nam{\expandafter
\XC@strip@comma\@@clr,,\@nnil}XC\@@mod}%
\let\@@cls\XC@mod@named
- \fi\fi
+ \fi
\ifx\@@cls\@empty\else
\let\@@tmp\@@cls
\@nameuse{define@color@\@@cls}\@@nam\@@drv
@@ -4218,40 +4795,79 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\XC@getmodclr}
+% \marg{mod-opt}\marg{clr-opt}\marg{model-list}\marg{spec-list}\marg{undefined}\marg{defined}\\
+% Depending on \Meta{mod-opt}, different tasks are performed:
+% \begin{itemize}
+% \item[0:] Retrieve color model and target model from \Meta{model-list} if |\XC@@getmod| is `true'.
+% \item[1:] Retrieve color model and target model from \Meta{model-list} always.
+% \end{itemize}
+% The color model is stored in |\@@mod|, its position in |\XC@@pos|, a possible target model in |\@@Mod|.
+% Depending on \Meta{clr-opt}, different tasks are performed:
+% \begin{itemize}
+% \item[0:] Don't pick color specification from \Meta{spec-list}.
+% \item[1:] Pick color specification from \Meta{spec-list}, convert it from model |\@@mod| to |\@@Mod|, unless the latter is `ignore' or |\@@cls| is `ps'.
+% \item[2:] Like the former case, additionally |\let\@@mod\@@Mod|.
+% \end{itemize}
+% The color specification is stored in |\@@clr|.
+% Color specification picking relies on the position |\XC@@pos|, conversion relies on the model |\@@mod|, and the target model |\@@Mod|.
+% If |\@@mod| represents an undefined color model, then \Meta{undefined} is executed at the end of the macro, else \Meta{defined}.
+% \begin{macrocode}
+\def\XC@getmodclr#1#2#3#4%
+ {\ifnum\ifcase#1 \ifXC@@getmod1\else0 \fi \or1 \fi>0
+ \XC@mdef\@@mod{#3}\expandafter\XC@getmod\@@mod////////\XC@@
+ \@ifundefinedmodel\@@Mod{\let\@@Mod\XC@mod@ignore}{}\fi
+ \@ifundefined{XC@mod@\@@mod}%
+ {\c@lor@error{model `\@@mod'}\@firstoftwo}%
+ {\ifcase#2\else
+ \XC@mdef\@@clr{#4}%
+ \edef\@@clr{\expandafter\XC@getclr\@@clr////////\XC@@}%
+ \ifx\@@cls\XC@mod@ps\else\XC@clean\@@clr\fi
+ \ifx\@@Mod\XC@mod@ignore\else
+ \convertcolorspec\@@mod\@@clr\@@Mod\@@clr
+ \ifnum#2>1 \let\@@mod\@@Mod\fi
+ \fi
+ \fi \@secondoftwo}}
+% \end{macrocode}
+%
% \begin{macro}{\XC@getmod}
-% \marg{model-list}\marg{position-cmd}\marg{model-cmd}\\
-% Retrieve color model from multiple definitions, separated by `|/|'.
-% This is being done by searching \Meta{model-list} for the current target model; if there is no match, the first listed model will be taken.
-% The position is saved in \Meta{position-cmd}, the resulting model is saved in \Meta{model-cmd}.
+% Retrieve model position |\XC@@pos|, model |\@@mod|, and target model |\@@Mod| from multiple definitions (up to~8), separated by `|/|'.
% \begin{macrocode}
-\def\XC@getmod#1#2#3%
- {\def\XC@getm@d##1/##2/##3/##4/##5/##6/##7/##8/##9:%
- {\XC@g@tm@d0{##1}\XC@g@tm@d1{##2}\XC@g@tm@d2{##3}\XC@g@tm@d3{##4}%
- \XC@g@tm@d4{##5}\XC@g@tm@d5{##6}\XC@g@tm@d6{##7}\XC@g@tm@d7{##8}%
- \def#2{0}\def#3{##1}\@gobble\@nnil}%
- \def\XC@g@tm@d##1##2%
- {\edef#2{##2}\XC@sdef#3{\XC@tgt@mod#2}%
- \ifx#2#3\def#2{##1}\expandafter\remove@to@nnil\fi}%
- \XC@mdef#3{#1}\expandafter\XC@getm@d#3////////:}
+\def\XC@getmod#1/#2/#3/#4/#5/#6/#7/#8/#9\XC@@
+ {\XC@g@tm@d0#1::\XC@@ \XC@getm@d1{#2}\XC@getm@d2{#3}%
+ \XC@getm@d3{#4}\XC@getm@d4{#5}\XC@getm@d5{#6}\XC@getm@d6{#7}%
+ \XC@getm@d7{#8}\def\XC@@pos{0}\def\@@mod{#1}\@gobble\@nnil}%
% \end{macrocode}
%
% \begin{macrocode}
-\newif\ifXC@@getmod \XC@@getmodtrue
+\def\XC@getm@d#1#2%
+ {\edef\XC@@pos{#2}\XC@sdef\@@mod{\XC@tgt@mod\XC@@pos}%
+ \ifx\XC@@pos\@@mod\def\XC@@pos{#1}\expandafter\remove@to@nnil\fi}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\XC@g@tm@d#1#2:#3:#4\XC@@
+ {\@ifxempty{#3}{\let\@@Mod\XC@mod@ignore\XC@getm@d0{#2}}%
+ {\def\@@Mod{#2}\XC@getm@d0{#3}}}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\XC@getclr}
-% \marg{spec-list}\marg{position}\marg{clr-cmd}\\
-% Pick color specification on position \Meta{position} from multiple definitions, separated by `|/|'.
-% The associated specification from \Meta{spec-list} is put into \Meta{clr-cmd}.
-% It is assumed that \Meta{position} contains a valid number, no checks are performed.
+% Pick color specification on position |\XC@@pos| from multiple definitions (up to~8), separated by `|/|'.
+% Expandable.
+% \begin{macrocode}
+\def\XC@getclr#1/#2/#3/#4/#5/#6/#7/#8/#9\XC@@
+ {\ifcase\XC@@pos\space #1\or#2\or#3\or#4\or#5\or#6\or#7\or#8\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifXC@@getmod}
+% Switch used to determine whether the model has to be retrieved (e.g., ordinary |\definecolor|) or not (e.g., |\definecolor| acting as subroutine to |\definecolorset|).
% \begin{macrocode}
-\def\XC@getclr#1#2#3%
- {\def\XC@getc@r##1/##2/##3/##4/##5/##6/##7/##8/##9:%
- {\ifcase#2 ##1\or##2\or##3\or##4\or##5\or##6\or##7\or##8\fi}%
- \XC@mdef#3{#1}\edef#3{\expandafter\XC@getc@r#3////////:}}
+\newif\ifXC@@getmod \XC@@getmodtrue
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\xdefinecolor}
% This command is identical with |\definecolor|, it is kept only for compatibility reasons.
@@ -4265,9 +4881,6 @@
% Similar to |\definecolor|, but the color \Meta{name} is only defined if it does not exist already.
% \begin{macrocode}
\def\providecolor{\@testopt{\XC@providecolor}{}}
-% \end{macrocode}
-%
-% \begin{macrocode}
\def\XC@providecolor[#1]#2%
{\@testopt{\XC@providec@lor[#1]{#2}}\colornameprefix}
% \end{macrocode}
@@ -4275,7 +4888,7 @@
% \begin{macrocode}
\def\XC@providec@lor[#1]#2[#3]%
{\XC@edef\XC@@tmp{#2}%
- \@ifundefined{\string\color@\XC@@tmp}{\XC@definecolor[#1]{#2}[#3]}%
+ \@ifundefinedcolor\XC@@tmp{\XC@definecolor[#1]{#2}[#3]}%
{\ifnum\XC@tracing>0
\PackageInfo{xcolor}{Ignoring color definition `\XC@@tmp'}\fi
\@gobbletwo}}
@@ -4296,13 +4909,7 @@
% Create a color `name' consisting of \Meta{color}, converted to \Meta{num model} if non-empty.
% \begin{macrocode}
\def\colorlet{\@testopt{\XC@colorlet}{}}
-% \end{macrocode}
-%
-% \begin{macrocode}
\def\XC@colorlet[#1]#2{\@testopt{\XC@col@rlet[#1]{#2}}{}}
-% \end{macrocode}
-%
-% \begin{macrocode}
\def\XC@col@rlet[#1]#2[#3]#4%
{\begingroup
\edef\@@cls{#1}\XC@edef\@@nam{#2}\XC@sdef\@@mod{#3}\XC@edef\@@clr{#4}%
@@ -4335,7 +4942,7 @@
%
% \begin{macrocode}
\def\XC@c@l@rlet#1#2%
- {\@ifundefined{\string\color@#2}%
+ {\@ifundefinedcolor{#2}%
{\c@lor@error{`#2'}\let\@@tmp\@empty}%
{\edef\@@tmp
{\ifglobalcolors\global\else\xglobal@\fi
@@ -4355,26 +4962,20 @@
% \subsubsection{Deferred definition}
%
% \begin{macro}{\preparecolor}
-% \oarg{type}\marg{name}\marg{model-list}\marg{spec-list}\\
+% \oarg{type}\marg{name}\oarg{prefix}\marg{model-list}\marg{spec-list}\\
% \begin{macrocode}
\def\preparecolor{\@testopt{\XC@preparecolor}{}}
-% \end{macrocode}
-%
-% \begin{macrocode}
\def\XC@preparecolor[#1]#2%
{\@testopt{\XC@preparec@lor[#1]{#2}}\colornameprefix}
% \end{macrocode}
%
% \begin{macrocode}
\def\XC@preparec@lor[#1]#2[#3]#4#5%
- {\XC@edef\@@nam{#2}%
- \ifXC@@getmod\XC@getmod{#4}\XC@@pos\@@mod\fi
- \XC@getclr{#5}\XC@@pos\@@clr
- \@ifundefined{XC@mod@\@@mod}%
- {\c@lor@error{model `\@@mod'}}%
+ {\XC@sdef\@@cls{#1}\XC@edef\@@nam{#2}%
+ \XC@getmodclr01{#4}{#5}{}%
{\xdef\XC@@stack
- {\ifx\XC@@stack\@empty\else\XC@@stack,\fi
- {#1}{\@@nam}{#3}{\@@mod}{\@@clr}}}}
+ {\ifx\XC@@stack\@empty\else\XC@@stack,\fi{#1}{\@@nam}{#3}%
+ {\ifx\@@Mod\XC@mod@ignore\@@mod\else\@@Mod\fi}{\@@clr}}}}
% \end{macrocode}
%
% \begin{macrocode}
@@ -4441,13 +5042,13 @@
%
% \begin{macrocode}
\def\XC@definecolorset[#1]#2#3#4#5%
- {\XC@getmod{#2}\XC@@pos\@@mod\XC@@getmodfalse\XC@edef\XC@@tmp{#5}%
- \let\XC@@glb\xglobal@
- \def\XC@definec@lorset##1,##2;%
- {\@ifxempty{##1}{}%
- {\let\xglobal@\XC@@glb
- \XC@@cmd[#1]{#3##1#4}{\@@mod}{##2}\XC@definec@lorset}}%
- \expandafter\XC@definec@lorset\XC@@tmp;,;\XC@@getmodtrue}
+ {\XC@getmodclr10{#2}{}{}%
+ {\XC@@getmodfalse\XC@edef\XC@@tmp{#5}\let\XC@@glb\xglobal@
+ \def\XC@definec@lorset##1,##2;%
+ {\@ifxempty{##1}{}%
+ {\let\xglobal@\XC@@glb
+ \XC@@cmd[#1]{#3##1#4}{\@@mod}{##2}\XC@definec@lorset}}%
+ \expandafter\XC@definec@lorset\XC@@tmp;,;\XC@@getmodtrue}}
% \end{macrocode}
% \end{macro}
%
@@ -4510,9 +5111,6 @@
% \oarg{div}\marg{name}
% \begin{macrocode}
\def\resetcolorseries{\@testopt{\XC@resetcolorseries}{}}
-% \end{macrocode}
-%
-% \begin{macrocode}
\def\XC@resetcolorseries[#1]#2%
{\begingroup
\@namexdef
@@ -4555,8 +5153,7 @@
{\edef\@@tmp{\@nameuse{\string\colorB@#1}}%
\expandafter\XC@st@p\@@tmp{#1}%
\edef\@@tmp
- {\noexpand\def\noexpand\@@mod{\@@mod}%
- \noexpand\def\noexpand\@@clr{\@@tmp}}}
+ {\def\noexpand\@@mod{\@@mod}\def\noexpand\@@clr{\@@tmp}}}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -4573,9 +5170,6 @@
% An empty \Meta{mix expr} argument will switch blending off.
% \begin{macrocode}
\def\blendcolors{\@ifstar{\XC@blendcolors\colorblend}{\XC@blendcolors{}}}
-% \end{macrocode}
-%
-% \begin{macrocode}
\def\XC@blendcolors#1#2%
{\edef\colorblend{#1}\XC@edef\XC@@tmp{#2}%
\ifx\XC@@tmp\@empty
@@ -4612,9 +5206,6 @@
% The optional \Meta{core model} argument may be used to determine the underlying color model.
% \begin{macrocode}
\def\maskcolors{\@testopt{\XC@maskcolors}{}}
-% \end{macrocode}
-%
-% \begin{macrocode}
\def\XC@maskcolors[#1]#2%
{\XC@edef\colormask{#2}%
\ifx\colormask\@empty
@@ -4638,11 +5229,11 @@
%
% \subsection{Color application}
%
-% \subsubsection{The core command}
+% \subsubsection{Standard color commands}
%
% \begin{macro}{\color}
% \marg{color}\\
-% \oarg{model}\marg{spec}\\
+% \oarg{model-list}\marg{spec-list}\\
% Switches to the color given either by name/expression or by model/specification.
% This color will stay in effect until the end of the current \TeX\ group.
% \begin{macrocode}
@@ -4652,35 +5243,36 @@
% \end{macro}
%
% \begin{macro}{\@undeclaredcolor}
-% \oarg{model}\marg{spec}\\
+% \oarg{model-list}\marg{spec-list}\\
% Display a color that is given by \Meta{model} name and numerical \Meta{spec}.
% \begin{macrocode}
\def\@undeclaredcolor[#1]#2%
{\begingroup
- \XC@sdef\@@mod{#1}\XC@edef\@@clr{#2}%
- \ifblendcolors
- \ifx\colorblend\@empty\else
- \edef\@@mix{\expandafter\@gobble\colorblend}\@tempswafalse
- \XC@coremodel\@@mod\@@clr\@xcolor@{}{}\@@mod\@@clr
+ \let\@@cls\@empty
+ \XC@getmodclr12{#1}{#2}{}%
+ {\ifblendcolors
+ \ifx\colorblend\@empty\else
+ \edef\@@mix{\expandafter\@gobble\colorblend}\@tempswafalse
+ \XC@coremodel\@@mod\@@clr\@xcolor@{}{}\@@mod\@@clr
+ \fi
\fi
- \fi
- \ifconvertcolorsU
- \edef\@@tmp{\XC@tgt@mod{\@@mod}}%
- \convertcolorspec\@@mod\@@clr\@@tmp\@@clr \let\@@mod\@@tmp
- \fi
- \ifmaskcolors
- \convertcolorspec\@@mod\@@clr\XC@mmod\@@clr
- \let\@@mod\XC@mmod
- \XC@inflate\@@mod\XC@mclr\@@clr\@@tmp
- \expandafter\XC@mul\@@tmp,\@@clr
- \fi
- \edef\@@tmp{\noexpand\XC@undeclaredcolor{\@@mod}{\@@clr}}%
- \expandafter\endgroup\@@tmp}
+ \ifconvertcolorsU
+ \edef\@@tmp{\XC@tgt@mod{\@@mod}}%
+ \convertcolorspec\@@mod\@@clr\@@tmp\@@clr \let\@@mod\@@tmp
+ \fi
+ \ifmaskcolors
+ \convertcolorspec\@@mod\@@clr\XC@mmod\@@clr
+ \let\@@mod\XC@mmod
+ \XC@inflate\@@mod\XC@mclr\@@clr\@@tmp
+ \expandafter\XC@mul\@@tmp,\@@clr
+ \fi
+ \edef\@@tmp{\noexpand\XC@undeclaredcolor{\@@mod}{\@@clr}}%
+ \expandafter\endgroup\@@tmp}}
% \end{macrocode}
%
% \begin{macrocode}
\def\XC@undeclaredcolor#1#2%
- {\@ifundefined{color@#1}%
+ {\@ifundefinedmodel{#1}%
{\c@lor@error{model `#1'}}%
{\@nameuse{color@#1}\current@color{#2}%
\edef\XC@current@color{\noexpand\xcolor@{}{\current@color}{#1}{#2}}%
@@ -4694,7 +5286,7 @@
% \begin{macrocode}
\def\@declaredcolor#1%
{\XC@edef\XC@@tmp{#1}\XC@@tstfalse
- \ifcase\XC@type{\XC@@tmp}\relax \XC@@tsttrue\or \relax\else
+ \ifcase\XC@type\XC@@tmp\relax \XC@@tsttrue\or \relax\else
\ifblendcolors\XC@@tsttrue\fi \ifmaskcolors\XC@@tsttrue\fi
\ifconvertcolorsU\XC@@tsttrue\fi
\fi
@@ -4718,8 +5310,216 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\textcolor}
+% \marg{color}\marg{text}\\
+% \oarg{model-list}\marg{spec-list}\marg{text}\\
+% are just alternative syntax for |\color|, in which the groups are added implicitly.
+% Thus \emph{text} appears in the specified color, but then the color reverts to its previous value.
+% The naming is by analogy with |\textrm| (as opposed to |\rm| and |\rmfamily|) although it is slightly a misnomer as the command also works in math-mode.
+% Additionally, it calls |\leavevmode| to ensure the start of horizontal mode.
+% \begin{macrocode}
+\def\textcolor#1#{\@textcolor{#1}}
+\def\@textcolor#1#2#3{\protect\leavevmode{\color#1{#2}#3}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pagecolor}
+% \marg{color}\\
+% \oarg{model-list}\marg{spec-list}\\
+% Specifies the background color for the current, and all following, pages.
+% It is a global declaration which does not respect \TeX\ groups.
+% \begin{macrocode}
+\def\pagecolor
+ {\begingroup
+ \let\ignorespaces\endgroup \let\set@color\set@page@color
+ \color}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Colored boxes}
+%
+% \begin{macro}{\colorbox}
+% \marg{color}\marg{text}\\
+% \oarg{model}\marg{spec}\marg{text}\\
+% Takes the same argument forms as |\textcolor|, but the color specifies the \emph{background} color of the box.
+% \begin{macrocode}
+\def\colorbox#1#{\color@box{#1}}
+\def\color@box#1#2{\color@b@x\relax{\color#1{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fcolorbox}
+% \marg{frame color}\marg{background color}\marg{text}\\
+% \oarg{model}\marg{frame spec}\marg{background spec}\marg{text}\\
+% \oarg{frame model}\marg{frame spec}\oarg{background model}\marg{background spec}\marg{text}\\
+% \marg{frame color}\oarg{background model}\marg{background spec}\marg{text}\\
+% Puts a frame of the first color around a box with a background specified by the second color.
+% If only the first optional argument is given, it specifies the color model for both colors.
+% \begin{macrocode}
+\def\fcolorbox#1#{\color@fbox{#1}}
+\def\color@fbox#1#2#3#{\color@fb@x{#1}{#2}{#3}}
+\def\color@fb@x#1#2#3#4%
+ {\color@b@x{\fboxsep\z@\color#1{#2}\XC@fbox}%
+ {\@ifxempty{#3}{\color#1}{\color#3}{#4}}}
+% \end{macrocode}
+% \end{macro}
%
-% \subsubsection{Internal commands}
+% \begin{macro}{\color@b@x}
+% Internal macro for |\colorbox| and |\fcolorbox|.
+% \begin{macrocode}
+\long\def\color@b@x#1#2#3%
+ {\leavevmode
+ \setbox\z@\hbox{\kern\fboxsep{\set@color#3}\kern\fboxsep}%
+ \dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@
+ \dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@
+ {#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}\box\z@}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@frameb@x}
+% Common part of |\framebox| and |\fbox|.
+% |#1| is a negative kern in the |\framebox| case so that the vertical rules do not add to the width of the box.
+% Optimised by \People{Donald}{Arseneau}.
+% \begin{macrocode}
+\def\XC@frameb@x#1%
+ {\hbox
+ {\@tempdima\fboxrule \advance\@tempdima\fboxsep
+ \advance\@tempdima\dp\@tempboxa
+ \setbox\@tempboxa\hbox
+ {\lower\@tempdima\hbox
+ {\vbox
+ {\kern\fboxrule
+ \hbox
+ {\kern\fboxrule#1%
+ \vbox{\kern\fboxsep\box\@tempboxa\kern\fboxsep}%
+ #1\kern\fboxrule}%
+ \kern\fboxrule}}}%
+ \@tempdima\wd\@tempboxa
+ \edef\@tempa{{\the\@tempdima}{\the\ht\@tempboxa}{\the\dp\@tempboxa}}%
+ \box\@tempboxa\kern-\@tempdima\expandafter\boxframe\@tempa}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@fbox}
+% \begin{macro}{\@frameb@x}
+% If no \Option{kernelfbox} option was specified, switch to the new method in general, else only for |\fcolorbox|.
+% \begin{macrocode}
+\ifXC@@fbox
+ \let\@frameb@x\XC@frameb@x \let\XC@fbox\fbox
+\else
+ \def\XC@fbox{\let\@frameb@x\XC@frameb@x\fbox}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Driver-specific and generic drawing}
+%
+% \begin{macro}{\color@block}
+% \marg{width}\marg{height}\marg{depth}\\
+% Should take up no space for \TeX, but produce a block in the current color of the specified size.
+% It is mainly used for producing box backgrounds.
+% \begin{macro}{\boxframe}
+% \marg{width}\marg{height}\marg{depth}\\
+% Draw a frame with a linewidth of |\fboxrule|.
+% Return a |\hbox| with outer dimensions \meta{width}, \meta{height}, \meta{depth}.
+
+% \begin{macro}{\XC@boxframe}
+% \marg{width}\marg{height}\marg{depth}\marg{frame construction}\\
+% Wrapper for |\boxframe| commands that return zero-dimension frames.
+% \begin{macrocode}
+\ifnum\XC@@xcd@>\m@ne
+\def\XC@boxframe#1#2#3#4%
+ {\hbox{\sbox\z@{\ifdim\fboxrule>\z@ #4\fi}%
+ \wd\z@#1\relax\ht\z@#2\relax\dp\z@#3\relax\box\z@}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \textbf{\Option{dvips}-optimised code}
+% \begin{macrocode}
+\ifcase\XC@@xcd@
+% \end{macrocode}
+%
+% \begin{macrocode}
+\providecommand*\color@block[3]%
+ {{\set@color\hbox
+ {\dimen@#3\edef\@tempa{ \number\dimen@\space}%
+ \dimen@#2\edef\@tempa{ \number\dimen@\@tempa}%
+ \dimen@#1\relax
+ \XC@special{\number\dimen@\@tempa XCcolorblock}}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\providecommand*\boxframe[3]%
+ {\XC@boxframe{#1}{#2}{#3}%
+ {\dimen@#3\edef\@tempa{ \number\dimen@\space}%
+ \dimen@#2\edef\@tempa{ \number\dimen@\@tempa}%
+ \dimen@#1\relax
+ \XC@special{\number\fboxrule\space\number\dimen@\@tempa XCboxframe}}}
+% \end{macrocode}
+%
+% \textbf{\Option{pdftex}-optimised code }
+% There seems to be no improvement by adding a specific |\color@block| command, since the PDF format doesn't offer higher accuracy than \TeX.
+% For |\boxframe| we want to achieve this PDF pseudo-code (besides initial scaling):\\[1ex]
+% \centerline{\ttfamily $l$ w [] $0$ d $2$ J $0$ j $4$ M
+% $1$ $0$ $0$ $1$ $\frac12\,l$ $\frac12\,l$ cm
+% $0$ $-d$ $(w-l)$ $(h+d-l)$ re s}
+% \begin{macrocode}
+\or
+% \end{macrocode}
+%
+% \begin{macrocode}
+\providecommand*\boxframe[3]%
+ {\XC@boxframe{#1}{#2}{#3}%
+ {\dimen@#3\edef\@tempa{ 0 -\strip@pt\dimen@\space}%
+ \edef\@tempb{\advance\dimen@\the\dimen@}%
+ \dimen@#2\advance\dimen@-\fboxrule\@tempb
+ \edef\@tempb{ \strip@pt\dimen@\space re s}%
+ \dimen@#1\advance\dimen@-\fboxrule
+ \edef\@tempb{ cm\@tempa\strip@pt\dimen@\@tempb}%
+ \dimen@.5\fboxrule\edef\@tempa{ \strip@pt\dimen@}%
+ \XC@special
+ {0.996264 0 0 0.996264 0 0 cm
+ \strip@pt\fboxrule\space w [] 0 d 2 J 0 j 4 M
+ 1 0 0 1\@tempa\@tempa\@tempb}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \textbf{Generic code }
+% The definition here works by selecting a color, and then drawing a \TeX\ rule (unless |\ifcolors@false|).
+% \begin{macrocode}
+\providecommand*\color@block[3]%
+ {{\set@color\rlap{\ifcolors@\vrule\@width#1\@height#2\@depth#3\fi}}}
+% \end{macrocode}
+%
+% The following definition was optimised by \People{Donald}{Arseneau}.
+% \begin{macrocode}
+\providecommand*\boxframe[3]%
+ {\hbox
+ {\dimen@#2\advance\dimen@#3\relax
+ \lower#3\vbox
+ {\hrule\@height\fboxrule
+ \@tempdima-0.5\fboxrule \ifodd\fboxrule\advance\@tempdima\m@ne sp\fi
+ \kern\@tempdima
+ \hbox
+ {\advance\dimen@-\fboxrule
+ \vrule\@width\fboxrule\@height\dimen@\@depth\z@
+ \@tempdima#1\advance\@tempdima-\tw@\fboxrule \kern\@tempdima
+ \vrule\@width\fboxrule\@height\dimen@\@depth\z@}%
+ \kern-0.5\fboxrule
+ \hrule\@height\fboxrule}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Color argument processing}
%
% \begin{macro}{\@xcolor@}
% \marg{type-spec}\marg{driver-spec}\marg{model}\marg{spec}\\
@@ -4775,51 +5575,59 @@
% Note: |\XC@split| opens a group which has to be closed afterwards by |\endgroup|.
% \begin{macrocode}
\def\XC@split#1%
- {\begingroup\XC@edef\@@tmp{#1}\expandafter\XC@split@i\@@tmp:\@nil}
+ {\begingroup\XC@edef\@@tmp{#1}\expandafter\XC@split@i\@@tmp>>\@nnil}
% \end{macrocode}
%
% \begin{macro}{\XC@split@i}
-% Check whether it is an \emph{extended} or \emph{standard} color expression.
+% Separate first part of expression chain and apply function(s) afterwards as requested.
% \begin{macrocode}
-\def\XC@split@i#1:#2\@nil
- {\@ifxempty{#2}{\XC@split@v}{\XC@split@ii#1,,:#2}}
+\def\XC@split@i#1>%
+ {\def\@@tmp{#1}\XC@split@ii#1:\@nil \XC@func}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\XC@split@ii}
+% Check whether it is an \emph{extended} or \emph{standard} color expression.
+% \begin{macrocode}
+\def\XC@split@ii#1:#2\@nil
+ {\@ifxempty{#2}{\XC@split@vi}{\XC@split@iii#1,,:#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@split@iii}
% Initialisation for extended color expressions.
% The magic \Meta{div} is either given as second argument, or calculated as the sum of all weights.
% \begin{macrocode}
-\def\XC@split@ii#1,#2,#3:#4:%
+\def\XC@split@iii#1,#2,#3:#4:%
{\edef\XC@@mod{#1}\let\@tempa\@empty
\ifx,#2,\XC@@tsttrue\@tempdima\z@\else\XC@@tstfalse\@tempdima#2\p@\fi
- \XC@split@iii#4;,;}
+ \XC@split@iv#4;,;}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\XC@split@iii}
+% \begin{macro}{\XC@split@iv}
% \marg{expr}\marg{dec}\\
% Step through the list of \Meta{expr},\Meta{dec} pairs.
% Add \Meta{dec} to the sum of weights (in order to calculate the ultimate \Meta{div}) and append pair information to |\@tempa| command.
% At the end of the list, execute |\@tempa| and map resulting parameter vector into unit cube.
% Finally, |\@@mod| and |\@@clr| contain the desired information about color model and parameters.
% \begin{macrocode}
-\def\XC@split@iii#1,#2;%
+\def\XC@split@iv#1,#2;%
{\@ifxempty{#1}%
{\let\XC@@clr\@empty \@tempa \expandafter\XC@calc@\XC@@clr,,,,:U%
\let\@@mod\XC@@mod \let\@@clr\@@tmp}
- {\XC@append\@tempa{\XC@split@iv{#1}{#2}}%
+ {\XC@append\@tempa{\XC@split@v{#1}{#2}}%
\ifXC@@tst\advance\@tempdima#2\p@\fi
- \XC@split@iii}}
+ \XC@split@iv}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\XC@split@iv}
+% \begin{macro}{\XC@split@v}
% \marg{expr}\marg{dec}\\
% Extract color specification from \Meta{expr}, convert to target model, multiply the resulting vector by the quotient of \Meta{dec} and \Meta{div}, add that vector to the overall parameter vector.
% \begin{macrocode}
-\def\XC@split@iv#1#2%
- {\def\@@tmp{#1}\XC@split@v
+\def\XC@split@v#1#2%
+ {\def\@@tmp{#1}\XC@split@vi
\ifx\@@mod\XC@@mod\else
\convertcolorspec\@@mod\@@clr\XC@@mod\@@clr
\fi
@@ -4833,30 +5641,30 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\XC@split@v}
+% \begin{macro}{\XC@split@vi}
% Start splitting process for standard color expression.
% \begin{macrocode}
-\def\XC@split@v{\count@\z@ \expandafter\XC@split@vi\@@tmp!\@nil}
+\def\XC@split@vi{\count@\z@ \expandafter\XC@split@vii\@@tmp!\@nil}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\XC@split@vi}
+% \begin{macro}{\XC@split@vii}
% Count number of `-' signs at the beginning of the string.
% \begin{macrocode}
-\def\XC@split@vi#1%
- {\ifx#1-\advance\count@\@ne\expandafter\XC@split@vi
- \else\expandafter\XC@split@vii\expandafter#1\fi}
+\def\XC@split@vii#1%
+ {\ifx#1-\advance\count@\@ne\expandafter\XC@split@vii
+ \else\expandafter\XC@split@viii\expandafter#1\fi}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\XC@split@vii}
+% \begin{macro}{\XC@split@viii}
% Extract \Meta{name} and \Meta{mix expr} part of color expression.
% Delegate control to |\@xcolor@|.
% \begin{macrocode}
-\def\XC@split@vii#1!#2\@nil
+\def\XC@split@viii#1!#2\@nil
{\edef\@@nam{#1}\edef\@@mix{#2}%
\ifodd\count@\@tempswatrue\else\@tempswafalse\fi
- \@ifundefined{\string\color@\@@nam}%
+ \@ifundefinedcolor\@@nam
{\c@lor@error{`\@@nam'}\def\@@nam{black}}{}%
\let\xcolor@\@xcolor@\@nameuse{\string\color@\@@nam}}
% \end{macrocode}
@@ -4880,20 +5688,66 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\XC@func}
+% \marg{function}|,{|\Meta[1]{arg}|,...,{|\Meta[n]{arg}|}>...\@nnil>|\\
+% General macro to handle color functions.
+% The number of arguments depends on the function.
+% Multiple consecutive functions may be applied.
+% Color model and specifications are input and output via |\@@mod| and |\@@clr|.
+% \begin{macrocode}
+\def\XC@func#1>{\@ifxempty{#1}{\remove@to@nnil}{\XC@fun@#1,>\XC@func}}
+\def\XC@fun@#1,#2>{\@nameuse{XC@func@#1}#2,,>}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@func@wheel}
+% \begin{macro}{\XC@func@twheel}
+% \marg{angle}|,|\marg{full circle}|,>|\\
+% Calculate color wheel position according to \Model{Hsb} or \Model{tHsb} model: \emph{hue} is rotated by \meta{angle} relative to \meta{full circle}.
+% The latter value is taken from |\rangeHsb| if left empty.
+% Finally, |\@@mod| is changed to \Model{hsb}.
+% \begin{macrocode}
+\def\XC@func@wheel#1,#2,#3>{\XC@func@wh@el{#1}{#2}0}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\XC@func@twheel#1,#2,#3>{\XC@func@wh@el{#1}{#2}1}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\XC@func@wh@el#1#2#3%
+ {\convertcolorspec\@@mod\@@clr
+ {\ifcase#3 \XC@mod@Hsb\or\XC@mod@tHsb\fi}\@@clr
+ \expandafter\XC@extract@hue\@@clr:\@@hue \dimen@#1\p@
+ \@ifxempty{#2}{}%
+ {\rdivide\dimen@{#2}\lshift\dimen@
+ \dimen@\rangeHsb\dimen@\rshift\dimen@}%
+ \advance\dimen@\@@hue\p@ \rdivide\dimen@\rangeHsb
+ \edef\@@hue{\strip@pt\dimen@}\XC@calcU\@@hue\@@hue
+ \ifcase#3
+ \expandafter\XC@replace@hue\@@clr:\@@hue,\@@clr
+ \or
+ \XC@c@lcS\rangeHsb{}\@@hue\@@hue
+ \expandafter\XC@replace@hue\@@clr:\@@hue,\@@clr
+ \convertcolorspec\XC@mod@tHsb\@@clr\XC@mod@hsb\@@clr
+ \fi
+ \let\@@mod\XC@mod@hsb}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\XC@display}
% Write information to log file and display the current color.
% \begin{macrocode}
\def\XC@display
{\XC@bcolor\XC@let@cN{\string\color@.}\XC@current@color
\ifnum\XC@type{.}=1
- \PackageWarning{xcolor}{Incompatible color definition}%
- \else
- \ifnum\XC@tracing>2
- \begingroup \let\xcolor@\@empty \def\@nil{\string\@nil}%
- \PackageInfo{xcolor}{Setting color `\XC@current@color'}%
- \endgroup
- \fi
- \fi
+ \PackageWarning{xcolor}{Incompatible color definition}\else
+ \ifnum\XC@tracing>2
+ \begingroup \let\xcolor@\@empty \def\@nil{\string\@nil}%
+ \PackageInfo{xcolor}{Setting color `\XC@current@color'}%
+ \endgroup
+ \fi\fi
\XC@mcolor\set@color\XC@ecolor\ignorespaces}
% \end{macrocode}
% \end{macro}
@@ -4915,94 +5769,6 @@
% \end{macro}
%
%
-% \subsubsection{Additional user-level commands}
-%
-% \begin{macro}{\textcolor}
-% \marg{color}\marg{text}\\
-% \oarg{model}\marg{spec}\marg{text}\\
-% are just alternative syntax for |\color|, in which the groups are added implicitly.
-% Thus \emph{text} appears in the specified color, but then the color reverts to its previous value.
-% The naming is by analogy with |\textrm| (as opposed to |\rm| and |\rmfamily|) although it is slightly a misnomer as the command also works in math-mode.
-% Additionally, it calls |\leavevmode| to ensure the start of horizontal mode.
-% \begin{macrocode}
-\def\textcolor#1#{\@textcolor{#1}}
-\def\@textcolor#1#2#3{\protect\leavevmode{\color#1{#2}#3}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\color@block}
-% \marg{width}\marg{height}\marg{depth}\\
-% Should take up no space for \TeX, but produce a block in the current color of the specified size.
-% It is mainly used for producing box backgrounds.
-%
-% The definition here works by selecting a color, and then drawing a \TeX\ rule (unless |\ifcolors@false|).
-% This allows the `driver independent' color specials to be used.
-% A graphics package may want to define it using a |\special| to produce (for example) a \Index{PostScript} line.
-% Producing the line in the |\special| has the advantage that on a preview that does not understand |\special|s, the line is automatically omited, without needing to modify the source of the document (for instance by adding the \Option{monochrome} option).
-% \begin{macrocode}
-\def\color@block#1#2#3{%
- {\set@color\rlap{\ifcolors@\vrule\@width#1\@height#2\@depth#3\fi}}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\colorbox}
-% \marg{color}\marg{text}\\
-% \oarg{model}\marg{spec}\marg{text}\\
-% Takes the same argument forms as |\textcolor|, but the color specifies the \emph{background} color of the box.
-% \begin{macrocode}
-\def\colorbox#1#{\color@box{#1}}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\def\color@box#1#2{\color@b@x\relax{\color#1{#2}}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\fcolorbox}
-% \marg{frame color}\marg{background color}\marg{text}\\
-% \oarg{model}\marg{frame spec}\marg{background spec}\marg{text}\\
-% Puts a frame of the first color around a box with a background specified by the second color.
-% If an optional argument is given, it specifies the color model for both colors.
-% \begin{macrocode}
-\def\fcolorbox#1#{\color@fbox{#1}}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\def\color@fbox#1#2#3{%
- \color@b@x{\fboxsep\z@\color#1{#2}\fbox}{\color#1{#3}}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\color@b@x}
-% Internal macro for |\colorbox| and |\fcolorbox|.
-% \begin{macrocode}
-\long\def\color@b@x#1#2#3{%
- \leavevmode
- \setbox\z@\hbox{\kern\fboxsep{\set@color#3}\kern\fboxsep}%
- \dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@
- \dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@
- {#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}%
- \box\z@}}}
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \subsubsection{Background (page) color}
-%
-% \begin{macro}{\pagecolor}
-% \marg{color}\\
-% \oarg{model}\marg{spec}\\
-% Specifies the background color for the current, and all following, pages.
-% It is a global declaration which does not respect \TeX\ groups.
-% \begin{macrocode}
-\def\pagecolor
- {\begingroup
- \let\ignorespaces\endgroup \let\set@color\set@page@color
- \color}
-% \end{macrocode}
-% \end{macro}
-%
-%
% \subsubsection{Border colors for hyperlinks}
%
% \begin{macro}{\XC@bordercolor}
@@ -5110,7 +5876,7 @@
% \begin{macro}{\rownum}
% Reserve a counter register.
% \begin{macrocode}
- \ifx\rownum\@undefined\newcount\rownum\fi
+ \@ifundefined{rownum}{\newcount\rownum}{}
% \end{macrocode}
% \end{macro}
%
@@ -5162,9 +5928,35 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\XC@extract@hue}
+% Extract first entry of comma-separated value list.
% \begin{macrocode}
\def\XC@extract@hue#1,#2:#3{\edef#3{#1}}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@extract@hue}
+% Change first entry of comma-separated value list.
+% \begin{macrocode}
+\def\XC@replace@hue#1,#2:#3,#4{\edef#4{#3,#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@ifundefinedcolor}
+% \marg{name}\marg{undefined}\marg{defined}\\
+% Checks whether \Meta{name} is a defined color name and executes the respective code.
+% \begin{macrocode}
+\def\@ifundefinedcolor#1{\@ifundefined{\string\color@#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@ifundefinedmodel}
+% \marg{model}\marg{undefined}\marg{defined}\\
+% Checks whether \Meta{model} is a defined color model and executes the respective code.
+% \begin{macrocode}
+\def\@ifundefinedmodel#1{\@ifundefined{color@#1}}
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\XC@type}
% \marg{name}\\
@@ -5207,15 +5999,17 @@
% 1 & explicit name& `|red|', `|green|'\\
% 2 & standard color expression& `|-red|', `|green!50|'\\
% 3 & extended color expression& `|rgb:-red,1;green!50,2|'\\
+% 4 & color function expression& `|rgb:-red,1;green!50,2>wheel,30|'\\
% \end{tabular}
% \end{center}
% \begin{macrocode}
\def\XC@info#1#2%
{\XC@edef#2{#1}%
- \if.#2\def#2{0}\else\expandafter\in@\expandafter:\expandafter{#2}%
+ \if.#2\def#2{0}\else\expandafter\in@\expandafter>\expandafter{#2}%
+ \ifin@\def#2{4}\else\expandafter\in@\expandafter:\expandafter{#2}%
\ifin@\def#2{3}\else\expandafter\in@\expandafter!\expandafter{#2}%
\ifin@\def#2{2}\else\edef#2{\noexpand\in@{/-}{/#2}}#2%
- \edef#2{\ifin@2\else1\fi}\fi\fi\fi}
+ \edef#2{\ifin@2\else1\fi}\fi\fi\fi\fi}
% \end{macrocode}
% \end{macro}
%
@@ -5237,7 +6031,7 @@
% \begin{macrocode}
\def\XC@logdef#1%
{\ifnum\XC@tracing>1
- \@ifundefined{\string\color@#1}%
+ \@ifundefinedcolor{#1}%
{\ifnum\XC@tracing>2
\PackageInfo{xcolor}{Defining color `#1'}%
\fi}%
@@ -5262,18 +6056,37 @@
\edef\@@num{\the\count@}%
% \end{macrocode}
%
+% Check whether the actual font belongs to a set of OT1-encoded monospaced fonts in order to display |>| instead of |\textgreater|.
+% \begin{macro}{\XC@@gt}
+% \begin{macrocode}
+ \def\XC@@gt{\textgreater}\def\@@tmp{OT1}%
+ \ifx\f@encoding\@@tmp
+ \@expandtwoargs\in@{,\f@family,}{,cmtt,pcr,}%
+ \ifin@\def\XC@@gt{>}\fi
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% Disable prologue and tracing commands for temporary color definitions.
+% \begin{macrocode}
+% \XC@@xcpfalse \ifnum\XC@tracing>1 \def\XC@tracing{1}\fi
+ \def\XC@@xcp@{-1}\ifnum\XC@tracing>1 \def\XC@tracing{1}\fi
+% \end{macrocode}
+%
% \begin{macro}{\testcolor}
% \marg{color}\\
-% \oarg{model}\marg{spec}\\
+% \oarg{model-list}\marg{spec-list}\\
% Each |\testcolor| command generates a table row.
% If the column-model matches the model of the color in question, its parameters are underlined.
% \begin{macrocode}
\def\testcolor{\@testopt{\@testcolor}{}}%
\def\@testcolor[##1]##2%
- {\@ifxempty{##1}%
- {\def\@@arg{##2&}\def\@@clr{##2}}%
- {\def\@@arg{[##1]{##2}&}\definecolor{*}{##1}{##2}\def\@@clr{*}}%
- \extractcolorspecs\@@clr\@@mod\@@clr
+ {\XC@mdef\@@mod{##1}\XC@edef\@@clr{##2}%
+ \ifx\@@mod\@empty
+ \let\@@arg\@@clr\XC@replace\@@arg>\XC@@gt\else
+ \edef\@@arg{[\@@mod]{\@@clr}}\XC@definecolor[]{*}\@@mod\@@clr
+ \def\@@clr{*}\fi
+ \XC@append\@@arg{&}\extractcolorspecs\@@clr\@@mod\@@clr
\@testc@lor}%
% \end{macrocode}
% \end{macro}
@@ -5399,6 +6212,8 @@
{\XC@ifxcase#1%
{\XC@mod@RGB {\convertcolorspec#1#2\XC@mod@rgb#2\let#1\XC@mod@rgb}%
\XC@mod@HTML{\convertcolorspec#1#2\XC@mod@rgb#2\let#1\XC@mod@rgb}%
+ \XC@mod@Hsb {\convertcolorspec#1#2\XC@mod@hsb#2\let#1\XC@mod@hsb}%
+ \XC@mod@tHsb{\convertcolorspec#1#2\XC@mod@hsb#2\let#1\XC@mod@hsb}%
\XC@mod@HSB {\convertcolorspec#1#2\XC@mod@hsb#2\let#1\XC@mod@hsb}%
\XC@mod@Gray{\convertcolorspec#1#2\XC@mod@gray#2\let#1\XC@mod@gray}%
\XC@mod@wave{\convertcolorspec#1#2\XC@mod@hsb#2\let#1\XC@mod@hsb}%
@@ -5416,19 +6231,22 @@
{\XC@mod@cmy {\XC@calc@#1,#2,#3,,:C}%
\XC@mod@cmyk
{\XC@calc@#1,#2,#3,,:C\expandafter\XC@cnv@cmy@cmyk\@@tmp,}%
- \XC@mod@hsb {\XC@cnv@rgb@hsb#1,#2,#3,}%
- \XC@mod@gray{\XC@cnv@rgb@gray#1,#2,#3,}%
\XC@mod@RGB {\edef\@@scl{\rangeRGB}\XC@calc@#1,#2,#3,,:M}%
\XC@mod@HTML{\edef\@@scl{\@cclv}\XC@calc@#1,#2,#3,,:M%
\expandafter\XC@calc@\@@tmp,,:H%
\expandafter\XC@cnv@rgb@HTML\@@tmp,}%
- \XC@mod@HSB {\XC@cnv@rgb@hsb#1,#2,#3,%
- \edef\@@scl{\rangeHSB}\expandafter\XC@calc@\@@tmp,,:M}%
- \XC@mod@Gray{\XC@cnv@rgb@gray#1,#2,#3,%
- \edef\@@scl{\rangeGray}\XC@calcM\@@tmp\@@tmp}}%
- {\XC@calc@#1,#2,#3,,:N}}
+ \XC@mod@gray{\XC@cnv@rgb@gray#1,#2,#3,}%
+ \XC@mod@Gray{\XC@cnv@rgb@gray#1,#2,#3,\XC@cnv@gray\@@tmp,}}%
+ {\XC@cnv@rgb@hsb#1,#2,#3,\XC@cnv@hsb@}}
+% \end{macrocode}
+%
+% \begin{macro}{\XC@cnv@rgb@}
+% \begin{macrocode}
+\def\XC@cnv@rgb@
+ {\ifx\tm\XC@mod@rgb\else\expandafter\XC@cnv@rgb\@@tmp,\fi}
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\XC@cnv@rgb@hsb}
% \Meta{red}|,|\Meta{green}|,|\Meta{blue}|,|
@@ -5491,18 +6309,11 @@
% \begin{macrocode}
\def\XC@cnv@cmy#1,#2,#3,%
{\XC@ifxcase\tm
- {\XC@mod@rgb {\XC@calc@#1,#2,#3,,:C}%
- \XC@mod@cmyk{\XC@cnv@cmy@cmyk#1,#2,#3,}%
- \XC@mod@hsb {\XC@calc@#1,#2,#3,,:C\expandafter\XC@cnv@rgb@hsb\@@tmp,}%
+ {\XC@mod@cmyk{\XC@cnv@cmy@cmyk#1,#2,#3,}%
\XC@mod@gray{\XC@cnv@rgb@gray#1,#2,#3,\XC@calcC\@@tmp\@@tmp}%
- \XC@mod@RGB {\XC@calc@#1,#2,#3,,:C%
- \edef\@@scl{\rangeRGB}\expandafter\XC@calc@\@@tmp,,:M}%
- \XC@mod@HTML{\XC@calc@#1,#2,#3,,:C\expandafter\XC@cnv@rgb\@@tmp,}%
- \XC@mod@HSB {\XC@calc@#1,#2,#3,,:C\expandafter\XC@cnv@rgb@hsb\@@tmp,%
- \edef\@@scl{\rangeHSB}\expandafter\XC@calc@\@@tmp,,:M}%
\XC@mod@Gray{\XC@cnv@rgb@gray#1,#2,#3,\XC@calcC\@@tmp\@@tmp
- \edef\@@scl{\rangeGray}\XC@calcM\@@tmp\@@tmp}}%
- {\XC@calc@#1,#2,#3,,:N}}
+ \XC@cnv@gray\@@tmp,}}%
+ {\XC@calc@#1,#2,#3,,:C\XC@cnv@rgb@}}
% \end{macrocode}
% \end{macro}
%
@@ -5532,27 +6343,12 @@
% \begin{macrocode}
\def\XC@cnv@cmyk#1,#2,#3,#4,%
{\XC@ifxcase\tm
- {\XC@mod@rgb
- {\XC@cnv@cmyk@cmy#1,#2,#3,#4,\expandafter\XC@calc@\@@tmp,,:C}%
- \XC@mod@cmy{\XC@cnv@cmyk@cmy#1,#2,#3,#4,}%
- \XC@mod@hsb
- {\XC@cnv@cmyk@cmy#1,#2,#3,#4,\expandafter\XC@calc@\@@tmp,,:C%
- \expandafter\XC@cnv@rgb@hsb\@@tmp,}%
- \XC@mod@gray{\XC@cnv@rgb@gray#1,#2,#3,%
- \edef\@@arg{#4}\XC@calcT\@@tmp\@@tmp \XC@calcC\@@tmp\@@tmp}%
- \XC@mod@RGB
- {\XC@cnv@cmyk@cmy#1,#2,#3,#4,\expandafter\XC@calc@\@@tmp,,:C%
- \edef\@@scl{\rangeRGB}\expandafter\XC@calc@\@@tmp,,:M}%
- \XC@mod@HTML
- {\XC@cnv@cmyk@cmy#1,#2,#3,#4,\expandafter\XC@cnv@cmy\@@tmp,}%
- \XC@mod@HSB
- {\XC@cnv@cmyk@cmy#1,#2,#3,#4,\expandafter\XC@calc@\@@tmp,,:C%
- \expandafter\XC@cnv@rgb@hsb\@@tmp,%
- \edef\@@scl{\rangeHSB}\expandafter\XC@calc@\@@tmp,,:M}%
- \XC@mod@Gray{\XC@cnv@rgb@gray#1,#2,#3,%
- \edef\@@arg{#4}\XC@calcT\@@tmp\@@tmp \XC@calcC\@@tmp\@@tmp
- \edef\@@scl{\rangeGray}\XC@calcM\@@tmp\@@tmp}}%
- {\XC@calc@#1,#2,#3,#4,:N}}
+ {\XC@mod@gray{\XC@cnv@rgb@gray#1,#2,#3,\edef\@@arg{#4}%
+ \XC@calcT\@@tmp\@@tmp \XC@calcC\@@tmp\@@tmp}%
+ \XC@mod@Gray{\XC@cnv@rgb@gray#1,#2,#3,\edef\@@arg{#4}%
+ \XC@calcT\@@tmp\@@tmp \XC@calcC\@@tmp\@@tmp \XC@cnv@gray\@@tmp,}}%
+ {\XC@cnv@cmyk@cmy#1,#2,#3,#4,%
+ \ifx\tm\XC@mod@cmy\else\expandafter\XC@cnv@cmy\@@tmp,\fi}}
% \end{macrocode}
% \end{macro}
%
@@ -5569,13 +6365,19 @@
% \Meta{hue}|,|\Meta{saturation}|,|\Meta{brightness}|,|
% \begin{macrocode}
\def\XC@cnv@hsb#1,#2,#3,%
- {\ifx\tm\XC@mod@HSB
- \edef\@@scl{\rangeHSB}\XC@calc@#1,#2,#3,,:M%
- \else
- \XC@cnv@hsb@rgb#1,#2,#3,%
- \ifx\tm\XC@mod@rgb\else\expandafter\XC@cnv@rgb\@@tmp,\fi
- \fi}
+ {\XC@ifxcase\tm
+ {\XC@mod@Hsb {\XC@cnv@hsb@Hsb#1,#2,#3,}%
+ \XC@mod@tHsb{\XC@cnv@hsb@Hsb#1,#2,#3,\expandafter\XC@cnv@Hsb\@@tmp,}%
+ \XC@mod@HSB {\edef\@@scl{\rangeHSB}\XC@calc@#1,#2,#3,,:M}}%
+ {\XC@cnv@hsb@rgb#1,#2,#3,\XC@cnv@rgb@}}
% \end{macrocode}
+%
+% \begin{macro}{\XC@cnv@hsb@}
+% \begin{macrocode}
+\def\XC@cnv@hsb@
+ {\ifx\tm\XC@mod@hsb\else\expandafter\XC@cnv@hsb\@@tmp,\fi}
+% \end{macrocode}
+% \end{macro}
% \end{macro}
%
% \begin{macro}{\XC@cnv@hsb@rgb}
@@ -5596,6 +6398,14 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\XC@cnv@hsb@Hsb}
+% \Meta{hue}|,|\Meta{saturation}|,|\Meta{brightness}|,|
+% \begin{macrocode}
+\def\XC@cnv@hsb@Hsb#1,#2,#3,%
+ {\XC@c@lcS\rangeHsb{,#2,#3}{#1}\@@tmp}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\XC@cnv@gray}
% \Meta{gray}|,|
% \begin{macrocode}
@@ -5604,7 +6414,6 @@
{\XC@mod@rgb {\XC@calcN{#1}\@@tmp \edef\@@tmp{\@@tmp,\@@tmp,\@@tmp}}%
\XC@mod@cmy {\XC@calcC{#1}\@@tmp \edef\@@tmp{\@@tmp,\@@tmp,\@@tmp}}%
\XC@mod@cmyk{\XC@calcC{#1}\@@tmp \edef\@@tmp{0,0,0,\@@tmp}}%
- \XC@mod@hsb {\XC@calcN{#1}\@@tmp \edef\@@tmp{0,0,\@@tmp}}%
\XC@mod@RGB {\edef\@@scl{\rangeRGB}\XC@calcM{#1}\@@tmp
\edef\@@tmp{\@@tmp,\@@tmp,\@@tmp}}%
\XC@mod@HTML{\edef\@@scl{\@cclv}\XC@calcM{#1}\@@tmp
@@ -5612,7 +6421,7 @@
\XC@mod@HSB {\edef\@@scl{\rangeHSB}\XC@calcM{#1}\@@tmp
\edef\@@tmp{0,0,\@@tmp}}%
\XC@mod@Gray{\edef\@@scl{\rangeGray}\XC@calcM{#1}\@@tmp}}%
- {\XC@calcN{#1}\@@tmp}}
+ {\XC@calcN{#1}\@@tmp \edef\@@tmp{0,0,\@@tmp}}}
% \end{macrocode}
% \end{macro}
%
@@ -5621,7 +6430,7 @@
% \Meta{Red}|,|\Meta{Green}|,|\Meta{Blue}|,|
% \begin{macrocode}
\def\XC@cnv@RGB#1,#2,#3,%
- {\edef\@@scl{\rangeRGB}\XC@calc@#1,#2,#3,,:D\expandafter\XC@cnv@rgb\@@tmp,}
+ {\edef\@@scl{\rangeRGB}\XC@calc@#1,#2,#3,,:D\XC@cnv@rgb@}
% \end{macrocode}
% \end{macro}
%
@@ -5631,8 +6440,7 @@
% \begin{macrocode}
\def\XC@cnv@HTML#1,%
{\edef\@@tmp{\expandafter\@hex@Hex#1\relax}\expandafter\XC@cnv@HTML@\@@tmp
- \edef\@@scl{\@cclv}\expandafter\XC@calc@\@@tmp,,:D%
- \expandafter\XC@cnv@rgb\@@tmp,}
+ \edef\@@scl{\@cclv}\expandafter\XC@calc@\@@tmp,,:D\XC@cnv@rgb@}
% \end{macrocode}
%
% \begin{macrocode}
@@ -5642,11 +6450,82 @@
% \end{macro}
%
%
+% \begin{macro}{\XC@cnv@Hsb}
+% \Meta{hue\Circ}|,|\Meta{saturation}|,|\Meta{brightness}|,|
+% \begin{macrocode}
+\def\XC@cnv@Hsb#1,#2,#3,%
+ {\ifx\tm\XC@mod@tHsb\XC@cnv@@Hsb#1,#2,#3,\XC@cnv@Hsb@
+ \else\XC@cnv@Hsb@hsb#1,#2,#3,\XC@cnv@hsb@\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@cnv@Hsb@hsb}
+% \Meta{hue\Circ}|,|\Meta{saturation}|,|\Meta{brightness}|,|
+% \begin{macrocode}
+\def\XC@cnv@Hsb@hsb#1,#2,#3,%
+ {\XC@c@lcD\rangeHsb{,#2,#3}{#1}\@@tmp}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@cnv@@Hsb}
+% \Meta{hue\Circ}|,|\Meta{saturation}|,|\Meta{brightness}|,|\marg{cmd}
+% \begin{macrocode}
+\def\XC@cnv@@Hsb#1,#2,#3,#4%
+ {\dimen@\rangeHsb\p@ \advance\dimen@\p@ \edef\@@tmp{\strip@pt\dimen@}%
+ \edef\@@tmp{0,0;\rangetHsb;\rangeHsb,\rangeHsb;\@@tmp,\@@tmp;}%
+ \dimen@#1\p@ \expandafter#4\@@tmp\@nnil
+ \edef\@@tmp{\strip@pt\dimen@,#2,#3}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@cnv@Hsb@}
+% \Meta{x}|,|\Meta{y}|;|\Meta{x'}|,|\Meta{y'}|;|
+% \begin{macrocode}
+\def\XC@cnv@Hsb@#1,#2;#3,#4;%
+ {\ifdim\dimen@<#4\p@
+ \@tempdima#3\p@ \advance\@tempdima-#1\p@
+ \@tempdimb#4\p@ \advance\@tempdimb-#2\p@
+ \rdivide\@tempdima\@tempdimb
+ \advance\dimen@-#2\p@ \rmultiply\dimen@{\strip@pt\@tempdima}%
+ \advance\dimen@#1\p@ \expandafter\remove@to@nnil
+ \else
+ \def\@@tmp{\XC@cnv@Hsb@#3,#4;}\expandafter\@@tmp
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\XC@cnv@tHsb}
+% \Meta{hue\Circ}|,|\Meta{saturation}|,|\Meta{brightness}|,|
+% \begin{macrocode}
+\def\XC@cnv@tHsb#1,#2,#3,%
+ {\XC@cnv@@Hsb#1,#2,#3,\XC@cnv@tHsb@
+ \ifx\tm\XC@mod@Hsb\else\expandafter\XC@cnv@Hsb\@@tmp,\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XC@cnv@tHsb@}
+% \Meta{x}|,|\Meta{y}|;|\Meta{x'}|,|\Meta{y'}|;|
+% \begin{macrocode}
+\def\XC@cnv@tHsb@#1,#2;#3,#4;%
+ {\ifdim\dimen@<#3\p@
+ \@tempdima#4\p@ \advance\@tempdima-#2\p@
+ \@tempdimb#3\p@ \advance\@tempdimb-#1\p@
+ \rdivide\@tempdima\@tempdimb
+ \advance\dimen@-#1\p@ \rmultiply\dimen@{\strip@pt\@tempdima}%
+ \advance\dimen@#2\p@ \expandafter\remove@to@nnil
+ \else
+ \def\@@tmp{\XC@cnv@tHsb@#3,#4;}\expandafter\@@tmp
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \begin{macro}{\XC@cnv@HSB}
% \Meta{Hue}|,|\Meta{Saturation}|,|\Meta{Brightness}|,|
% \begin{macrocode}
\def\XC@cnv@HSB#1,#2,#3,%
- {\edef\@@scl{\rangeHSB}\XC@calc@#1,#2,#3,,:D\expandafter\XC@cnv@hsb\@@tmp,}
+ {\edef\@@scl{\rangeHSB}\XC@calc@#1,#2,#3,,:D\XC@cnv@hsb@}
% \end{macrocode}
% \end{macro}
%
@@ -5655,7 +6534,7 @@
% \Meta{Gray}|,|
% \begin{macrocode}
\def\XC@cnv@Gray#1,%
- {\edef\@@scl{\rangeGray}\XC@calcD{#1}\@@tmp \XC@cnv@gray\@@tmp,}
+ {\XC@c@lcD\rangeGray{}{#1}\@@tmp \XC@cnv@gray\@@tmp,}
% \end{macrocode}
% \end{macro}
%
@@ -5664,8 +6543,7 @@
% \Meta{lambda}|,|
% \begin{macrocode}
\def\XC@cnv@wave#1,%
- {\XC@cnv@wave@hsb#1,%
- \ifx\tm\XC@mod@hsb\else\expandafter\XC@cnv@hsb\@@tmp,\fi}
+ {\XC@cnv@wave@hsb#1,\XC@cnv@hsb@}
% \end{macrocode}
% \end{macro}
%
@@ -5679,18 +6557,16 @@
% Calculate hue:
% \begin{macrocode}
\ifdim\@tempdima<440\p@
- \XC@c@v@wave@hsb{-.0166667}{7.33333}4{}%
- \else\ifdim\@tempdima<490\p@
- \XC@c@v@wave@hsb{.02}{-8.8}4-%
- \else\ifdim\@tempdima<510\p@
- \XC@c@v@wave@hsb{-.05}{25.5}2{}%
- \else\ifdim\@tempdima<580\p@
- \XC@c@v@wave@hsb{.0142857}{-7.28571}2-%
- \else\ifdim\@tempdima<645\p@
- \XC@c@v@wave@hsb{-.0153846}{9.92308}0{}%
- \else
- \dimen@\z@
- \fi\fi\fi\fi\fi
+ \XC@c@v@wave@hsb{-.0166667}{7.33333}4{}\else
+ \ifdim\@tempdima<490\p@
+ \XC@c@v@wave@hsb{.02}{-8.8}4-\else
+ \ifdim\@tempdima<510\p@
+ \XC@c@v@wave@hsb{-.05}{25.5}2{}\else
+ \ifdim\@tempdima<580\p@
+ \XC@c@v@wave@hsb{.0142857}{-7.28571}2-\else
+ \ifdim\@tempdima<645\p@
+ \XC@c@v@wave@hsb{-.0153846}{9.92308}0{}\else
+ \dimen@\z@ \fi\fi\fi\fi\fi
\divide\dimen@6\relax
\edef\@@tmp{\strip@pt\dimen@,1,}%
% \end{macrocode}
@@ -5698,12 +6574,10 @@
% Calculate brightness:
% \begin{macrocode}
\ifdim\@tempdima<420\p@
- \XC@c@v@wave@hsb{.0175}{-6.35}0{}%
- \else\ifdim\@tempdima>700\p@
- \XC@c@v@wave@hsb{-.00875}{7.125}0{}%
- \else
- \dimen@\p@
- \fi\fi
+ \XC@c@v@wave@hsb{.0175}{-6.35}0{}\else
+ \ifdim\@tempdima>700\p@
+ \XC@c@v@wave@hsb{-.00875}{7.125}0{}\else
+ \dimen@\p@ \fi\fi
\edef\@@tmp{\@@tmp\strip@pt\dimen@}}
% \end{macrocode}
% \end{macro}
@@ -5715,8 +6589,7 @@
% \begin{macrocode}
\def\XC@c@v@wave@hsb#1#2#3#4%
{\dimen@#1\@tempdima \advance\dimen@#2\p@
- \edef\@tempa{\strip@pt\dimen@}%
- \XC@calcR\@tempa\@tempa
+ \XC@calcR{\strip@pt\dimen@}\@tempa
\dimen@#4\@tempa\p@ \advance\dimen@#3\p@}
% \end{macrocode}
% \end{macro}
@@ -5729,8 +6602,7 @@
% \begin{macrocode}
\def\XC@cnv@cmyk@compl#1,#2,#3,#4,%
{\XC@cnv@cmyk@cmy#1,#2,#3,#4,%
- \expandafter\XC@calc@\@@tmp,,:C%
- \expandafter\XC@cnv@cmy@cmyk\@@tmp,}
+ \expandafter\XC@calc@\@@tmp,,:C\expandafter\XC@cnv@cmy@cmyk\@@tmp,}
% \end{macrocode}
% \end{macro}
%
@@ -5739,10 +6611,8 @@
% \begin{macrocode}
\def\XC@cnv@hsb@compl#1,#2,#3,%
{\lshiftset\dimen@{#1}\advance\dimen@\ifdim\dimen@<5\p@-\fi-5\p@
- \rshift\dimen@
- \edef\@@tmp{\strip@pt\dimen@}%
- \lshiftset\dimen@{#3}%
- \@tempdima#2\dimen@
+ \rshift\dimen@ \edef\@@tmp{\strip@pt\dimen@}%
+ \lshiftset\dimen@{#3}\@tempdima#2\dimen@
\@tempdimb\@tempdima \advance\@tempdimb10\p@ \advance\@tempdimb-\dimen@
\ifdim\@tempdimb=\z@
\edef\@@tmp{\@@tmp,0,0}%
@@ -5761,7 +6631,7 @@
%
% These macros provide generic support for missing color models in specific drivers.
% For example, \File{pdftex.def} does not support the \Model{hsb} model.
-% It is assumed that at least one of the models \Model{rgb}, \Model{RGB}, \Model{HTML}, \Model{hsb}, \Model{HSB}, \Model{cmy}, \Model{cmyk}, \Model{gray}, \Model{Gray} exists.
+% It is assumed that at least one of the models \Model{rgb}, \Model{RGB}, \Model{HTML}, \Model{hsb}, \Model{Hsb}, \Model{HSB}, \Model{cmy}, \Model{cmyk}, \Model{gray}, \Model{Gray} exists.
%
% \begin{macro}{\substitutecolormodel}
% \marg{source model}\marg{target model-list}\\
@@ -5769,21 +6639,25 @@
% each reference to the driver-specific command |\color@|\Meta{source model} is replaced by a color model conversion, followed by the driver-specific command |\color@|\Meta{target model}.
% \begin{macrocode}
\def\substitutecolormodel#1#2%
- {\edef\XC@@tmp{\expandafter\XC@substitutecolormodel#2/ignore/\@nnil}%
- \expandafter\edef\csname color@#1\endcsname##1##2%
- {\noexpand\convertcolorspec
- \expandafter\noexpand\csname XC@mod@#1\endcsname{##2}%
- \expandafter\noexpand\csname XC@mod@\XC@@tmp\endcsname
- \noexpand\XC@@tmp\noexpand\expandafter
- \expandafter\noexpand\csname color@\XC@@tmp\endcsname
- \noexpand\expandafter##1\noexpand\expandafter{\noexpand\XC@@tmp}}%
+ {\XC@sdef\XC@@tmp{\expandafter\XC@substitutecolormodel#2/ignore/\@nnil}%
+ \ifx\XC@@tmp\XC@mod@ignore
+ \XC@let@cN{color@#1}\color@ignore
+ \else
+ \expandafter\edef\csname color@#1\endcsname##1##2%
+ {\noexpand\convertcolorspec
+ \expandafter\noexpand\csname XC@mod@#1\endcsname{##2}%
+ \expandafter\noexpand\csname XC@mod@\XC@@tmp\endcsname
+ \noexpand\XC@@tmp\noexpand\expandafter
+ \expandafter\noexpand\csname color@\XC@@tmp\endcsname
+ \noexpand\expandafter##1\noexpand\expandafter{\noexpand\XC@@tmp}}%
+ \fi
\expandafter\xglobalize@\csname color@#1\endcsname \xglobal@stop
\PackageInfo{xcolor}{Model `#1' substituted by `\XC@@tmp'}}
% \end{macrocode}
%
% \begin{macrocode}
\def\XC@substitutecolormodel#1/%
- {\@ifundefined{color@#1}{\XC@substitutecolormodel}{#1\remove@to@nnil}}
+ {\@ifundefinedmodel{#1}{\XC@substitutecolormodel}{#1\remove@to@nnil}}
% \end{macrocode}
% \end{macro}
%
@@ -5801,22 +6675,22 @@
% For example, if \File{dvips.def} is loaded, then |\color@rgb\foo{1,0,0}| will be equivalent to |\def\foo{rgb 1 0 0}|.
% In the case of \File{pdftex.def}, it will act like |\def\foo{1 0 0 rg 1 0 0 RG}| instead.
% \begin{macrocode}
-\@ifundefined{color@rgb}%
- {\substitutecolormodel{rgb}{RGB/HTML/hsb/HSB/cmy/cmyk/gray/Gray}}{}
+\@ifundefinedmodel{rgb}%
+ {\substitutecolormodel{rgb}{RGB/HTML/hsb/Hsb/HSB/cmy/cmyk/gray/Gray}}{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\color@cmyk}
% \marg{cmd}\marg{spec}
% \begin{macrocode}
-\@ifundefined{color@cmyk}{\substitutecolormodel{cmyk}{cmy/rgb}}{}
+\@ifundefinedmodel{cmyk}{\substitutecolormodel{cmyk}{cmy/rgb}}{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\color@cmy}
% \marg{cmd}\marg{spec}
% \begin{macrocode}
-\@ifundefined{color@cmy}%
+\@ifundefinedmodel{cmy}%
{\PackageInfo{xcolor}{Model `cmy' substituted by `cmy0'}
\def\color@cmy#1#2{\color@cmyk#1{#2,0}}}{}
% \end{macrocode}
@@ -5826,12 +6700,10 @@
% \marg{cmd}\marg{spec}\\
% Since the \Option{dvipdfm} and \Option{textures} drivers only pretend to support \Model{hsb}, we have to check for these drivers.
% \begin{macrocode}
-\@ifundefined{color@hsb}{\@tempswatrue}%
- {\@tempswafalse
- \@tfor\@@tmp:={dvipdfm}{textures}\do
- {\ifx\@@tmp\XC@@drv\@tempswatrue\@break@tfor\fi}}
+\@ifundefinedmodel{hsb}{\@tempswatrue}%
+ {\XC@ifcase\XC@@drv{{dvipdfm,textures}\@tempswatrue}\@tempswafalse}
\if@tempswa
- \substitutecolormodel{hsb}{HSB/rgb}
+ \substitutecolormodel{hsb}{Hsb/HSB/rgb}
\fi
% \end{macrocode}
% \end{macro}
@@ -5840,7 +6712,7 @@
% \marg{cmd}\marg{spec}\\
% If the model is supported and |\rangeRGB| equals 255, we stick to the algorithm provided by the driver.
% \begin{macrocode}
-\@ifundefined{color@RGB}%
+\@ifundefinedmodel{RGB}%
{\substitutecolormodel{RGB}{HTML/rgb}}
{\PackageInfo{xcolor}{Model `RGB' extended}
\let\XC@color@RGB\color@RGB
@@ -5856,22 +6728,28 @@
%
% \begin{macro}{\color@gray}
% \begin{macro}{\color@HTML}
+% \begin{macro}{\color@Hsb}
+% \begin{macro}{\color@tHsb}
% \begin{macro}{\color@HSB}
% \begin{macro}{\color@Gray}
% \begin{macro}{\color@wave}
% \marg{cmd}\marg{spec}
% \begin{macrocode}
-\@ifundefined{color@gray}{\substitutecolormodel{gray}{Gray/rgb}}{}
-\@ifundefined{color@HTML}{\substitutecolormodel{HTML}{rgb}}{}
-\@ifundefined{color@HSB}{\substitutecolormodel{HSB}{hsb}}{}
-\@ifundefined{color@Gray}{\substitutecolormodel{Gray}{gray}}{}
-\@ifundefined{color@wave}{\substitutecolormodel{wave}{hsb}}{}
+\@ifundefinedmodel{gray}{\substitutecolormodel{gray}{Gray/rgb}}{}
+\@ifundefinedmodel{HTML}{\substitutecolormodel{HTML}{rgb}}{}
+\@ifundefinedmodel{Hsb}{\substitutecolormodel{Hsb}{hsb}}{}
+\@ifundefinedmodel{tHsb}{\substitutecolormodel{tHsb}{hsb}}{}
+\@ifundefinedmodel{HSB}{\substitutecolormodel{HSB}{hsb}}{}
+\@ifundefinedmodel{Gray}{\substitutecolormodel{Gray}{gray}}{}
+\@ifundefinedmodel{wave}{\substitutecolormodel{wave}{hsb}}{}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
%
% \subsubsection{PostScript-related stuff}
@@ -5931,10 +6809,10 @@
% \begin{macrocode}
}{% compatibility code begin
\def\XC@getcolor#1#2%
- {\@ifundefined{\string\color@#1}%
+ {\@ifundefinedcolor{#1}%
{\begingroup\color{#1}%
\edef\@@tmp
- {\noexpand\edef\noexpand#2{\noexpand\expandafter\noexpand\c@lor@to@ps
+ {\edef\noexpand#2{\noexpand\expandafter\noexpand\c@lor@to@ps
\current@color\noexpand\@@}}%
\expandafter\endgroup\@@tmp}%
{\edef#2{\XC@usecolor{#1}}}}
@@ -5949,9 +6827,6 @@
% Note that non-trivial color expressions like |green!50| are forbidden and that |\XC@usecolor| is fully expandable, for example, |\edef\foo{\XC@usecolor{green}}| is valid.
% \begin{macrocode}
\def\XC@usecolor#1{\expandafter\XC@usec@lor#1\XC@@}
-% \end{macrocode}
-%
-% \begin{macrocode}
\def\XC@usec@lor#1#2\XC@@
{\ifx#1\xcolor@
\expandafter\expandafter\expandafter\c@lor@to@ps#1#2\@@
@@ -5962,14 +6837,14 @@
\space}
% \end{macrocode}
%
-% For compatibility reasons, we need the following command temporarily; however, |\XC@c@lor@to@ps| will disappear soon!
+% For compatibility reasons, we need the following command temporarily; however, |\XC@c@lor@to@ps| will disappear!
% \begin{macrocode}
\let\XC@c@lor@to@ps\XC@usecolor
% \end{macrocode}
% \end{macro}
%
% If \Package{pstcol} has been loaded, we have to redefine two macros from this package.
-% The conditional code is needed temporarily, until a new version of \Package{pstricks} is released.
+% The conditional code is needed temporarily, until nobody uses old \Package{pstricks} versions anymore.
% \begin{macrocode}
\let\pst@getcolor\XC@getcolor
\@ifundefined{XC@pst}{%
@@ -6007,7 +6882,7 @@
\AtBeginDocument{\let\default@color\current@color}
% \end{macrocode}
% \end{macro}
-% |\current@color| (which is the first-level expansion of |\XC@current@color|) contains an internal representation of the color at this point in the document.
+% |\current@color| (which is the expansion of |\XC@current@color|) contains an internal representation of the color at this point in the document.
% This can only be an approximation to the truth as the `macro layer' of \TeX\ does not know where the output routine is going to re-insert floats.
% This is why drivers must maintain their own stack of colors in order to fully support these commands.
%
@@ -6018,41 +6893,40 @@
% \begin{macro}{\define@color@named}
% We have to modify a few driver-specific commands in order to avoid generation of superfluous macros.
% \begin{macrocode}
-\@tfor\@@tmp:={dvipdf}{dvipdfm}{dvipdfmx}{dvips}{pctex32}\do
- {\ifx\@@tmp\XC@@drv
- \def\c@lor@@named#1,#2,#3\@@#4%
- {\edef#4{\expandafter\expandafter\expandafter\@thirdoffive
- \csname\string\color@#1\endcsname}}
- \def\define@color@named#1#2%
- {\@namedef{\string\color@#1}{{}{}{ \colornameprefix#1}{}{}}}
- \@break@tfor\fi}
+\XC@ifcase\XC@@drv
+ {{dvipdf,dvipdfm,dvipdfmx,dvips,pctex32}%
+ {\def\c@lor@@named#1,#2,#3\@@#4%
+ {\edef#4{\expandafter\expandafter\expandafter\@thirdoffive
+ \csname\string\color@#1\endcsname}}
+ \def\define@color@named#1#2%
+ {\@namedef{\string\color@#1}{{}{}{ \colornameprefix#1}{}{}}}}%
% \end{macrocode}
%
% \begin{macrocode}
-\@tfor\@@tmp:={dvipsone}{pctexps}{pdftex}{tcidvi}{truetex}{vtex}{xetex}\do
- {\ifx\@@tmp\XC@@drv
- \def\c@lor@@named#1,#2,#3\@@#4%
- {\edef#4{\expandafter\expandafter\expandafter\@thirdoffive
- \csname\string\color@#1\endcsname}}
- \def\define@color@named#1#2%
- {\let\@@cls\@empty\@namedef{\string\color@#1}{{}{}{#2}{}{}}}
- \@break@tfor\fi}
+ {dvipsone,pctexps,pdftex,tcidvi,truetex,vtex,xetex}%
+ {\def\c@lor@@named#1,#2,#3\@@#4%
+ {\edef#4{\expandafter\expandafter\expandafter\@thirdoffive
+ \csname\string\color@#1\endcsname}}
+ \def\define@color@named#1#2%
+ {\let\@@cls\@empty\@namedef{\string\color@#1}{{}{}{#2}{}{}}}}%
% \end{macrocode}
%
% \begin{macrocode}
-\@tfor\@@tmp:={textures}\do
- {\ifx\@@tmp\XC@@drv
- \def\c@lor@@named#1,#2,#3\@@#4%
- {\edef\@tempa{\color@P@custom{#1}{\if!#2!1\else#2\fi}}%
- \expandafter\def\expandafter#4\@tempa}
- \def\define@color@named#1#2%
- {\edef\@tempa{{#1}{#2}}\expandafter\AddCustomColor\@tempa}
- \def\c@lor@ps@#1 #2\@@
- {\expandafter\expandafter\expandafter\expandafter\expandafter
- \expandafter\expandafter\c@lor@to@ps@
- \csname\string\color@#1\expandafter\endcsname\space
- #2. \@@{#1}}
- \@break@tfor\fi}
+ {textures}%
+ {\def\c@lor@@named#1,#2,#3\@@#4%
+ {\edef\@tempa{\color@P@custom{#1}{\if!#2!1\else#2\fi}}%
+ \expandafter\def\expandafter#4\@tempa}
+ \def\define@color@named#1#2%
+ {\edef\@tempa{{#1}{#2}}\expandafter\AddCustomColor\@tempa}
+ \def\c@lor@ps@#1 #2\@@
+ {\expandafter\expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\c@lor@to@ps@
+ \csname\string\color@#1\expandafter\endcsname\space
+ #2. \@@{#1}}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ }{}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -6116,9 +6990,6 @@
% \begin{macrocode}
\csname xcolorcmd\endcsname
\color{black}
-% \end{macrocode}
-%
-% \begin{macrocode}
%</package>
% \end{macrocode}
%
@@ -6129,20 +7000,78 @@
%
% \subsection{Auxiliary definitions}
%
-% \subsubsection{PostScript prologue}
+% \subsubsection{\Index{PostScript} prologue file \File{xcolor.pro}}
%
% \begin{macrocode}
%<*dvips>
userdict begin
/setcmycolor{0 setcmykcolor}def
-/XCdef{exch dup TeXDict exch known{pop pop}{exch def}ifelse}bind def
-/XCbdef{bind XCdef}bind def
-/XCsetcolor{cvx counttomark array astore cvx exch pop XCdef}XCbdef
-/XCcmy{mark exch exec /setcmycolor XCsetcolor}XCbdef
-/XCcmyk{mark exch exec /setcmykcolor XCsetcolor}XCbdef
-/XCgray{mark exch exec /setgray XCsetcolor}XCbdef
-/XChsb{mark exch exec /sethsbcolor XCsetcolor}XCbdef
-/XCrgb{mark exch exec /setrgbcolor XCsetcolor}XCbdef
+/XCbd{bind def}bind def
+/XCed{exch def}XCbd
+% \end{macrocode}
+%
+% \Index{PostScript} version of |\providecommand|.
+% \begin{macrocode}
+/XCdef{exch dup TeXDict exch known{pop pop}{XCed}ifelse}XCbd
+% \end{macrocode}
+%
+% \Index{PostScript} version of |\providecolor|.
+% \begin{macrocode}
+/XCsetcolor{cvx counttomark array astore cvx exch pop XCdef}XCbd
+% \end{macrocode}
+%
+% Now define model-dependent color definition commands.
+% \begin{macrocode}
+/XCcmy{mark exch exec/setcmycolor XCsetcolor}XCbd
+/XCcmyk{mark exch exec/setcmykcolor XCsetcolor}XCbd
+/XCgray{mark exch exec/setgray XCsetcolor}XCbd
+/XChsb{mark exch exec/sethsbcolor XCsetcolor}XCbd
+/XCrgb{mark exch exec/setrgbcolor XCsetcolor}XCbd
+% \end{macrocode}
+%
+% Grouping operators.
+% We have to disable the |setgray| operator which is invoked by |normalscale| as part of |@beginspecial| as defined by \File{special.pro}.
+% \begin{macrocode}
+/XC!b{save/setgray{pop}def}XCbd
+/XC!e{restore}XCbd
+% \end{macrocode}
+%
+% Scale `sp' coordinates back to `bp' units.
+% \begin{macrocode}
+/XCsp2bp{1 65781.76 div dup scale}XCbd
+% \end{macrocode}
+%
+% \begin{macro}{XCsetline}
+% \meta{linewidth} |XCsetline|\\
+% Common line definition.
+% \begin{macrocode}
+/XCsetline
+ {setlinewidth [] 0 setdash 2 setlinecap 0 setlinejoin 4 setmiterlimit}XCbd
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{XCboxframe}
+% \meta{linewidth} \meta{width} \meta{height} \meta{depth} |XCboxframe|\\
+% Draw a frame in `sp' coordinates using LanguageLevel~2.
+% \begin{macrocode}
+/XCboxframe{/d XCed/h XCed/w XCed/l XCed w 0 gt{h d neg gt{l 0 gt
+ {XCsp2bp l XCsetline
+ l 2 div dup translate
+ 0 d neg w l sub h l sub d add rectstroke}if}if}if}XCbd
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{XCcolorblock}
+% \meta{width} \meta{height} \meta{depth} |XCcolorblock|\\
+% Draw a colored box in `sp' coordinates using LanguageLevel~2.
+% \begin{macrocode}
+/XCcolorblock{/d XCed/h XCed/w XCed w 0 gt{h d neg gt
+ {XCsp2bp 0 XCsetline
+ 0 d neg w h d add rectfill}if}if}XCbd
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
end
%</dvips>
% \end{macrocode}
@@ -6155,9 +7084,9 @@ end
%
% \iffalse
%-------------------------------------------------------------------------------
-%<*svgnames|hksknames|hksnnames|hksznames|pmsnames|ralnames>
+%<*svgnames|x11names|hksknames|hksnnames|hksznames|pmsnames|ralnames>
\def\colornameprefix{XC@}
-%</svgnames|hksknames|hksnnames|hksznames|pmsnames|ralnames>
+%</svgnames|x11names|hksknames|hksnnames|hksznames|pmsnames|ralnames>
%
%<*svgnames>
\preparecolorset{rgb}{}{}{%
@@ -6215,9 +7144,9 @@ GhostWhite,.972,.972,1;%
Gold,1,.844,0;%
Goldenrod,.855,.648,.125;%
Gray,.5,.5,.5;%
-Grey,.5,.5,.5;%
Green,0,.5,0;%
GreenYellow,.68,1,.185;%
+Grey,.5,.5,.5;%
Honeydew,.94,1,.94;%
HotPink,1,.41,.705;%
IndianRed,.804,.36,.36;%
@@ -6231,6 +7160,7 @@ LemonChiffon,1,.98,.804;%
LightBlue,.68,.848,.9;%
LightCoral,.94,.5,.5;%
LightCyan,.88,1,1;%
+LightGoldenrod,.933,.867,.51;%
LightGoldenrodYellow,.98,.98,.824;%
LightGray,.828,.828,.828;%
LightGreen,.565,.932,.565;%
@@ -6239,6 +7169,7 @@ LightPink,1,.712,.756;%
LightSalmon,1,.628,.48;%
LightSeaGreen,.125,.698,.668;%
LightSkyBlue,.53,.808,.98;%
+LightSlateBlue,.518,.44,1;%
LightSlateGray,.468,.532,.6;%
LightSlateGrey,.468,.532,.6;%
LightSteelBlue,.69,.77,.87;%
@@ -6263,6 +7194,7 @@ MistyRose,1,.894,.884;%
Moccasin,1,.894,.71;%
NavajoWhite,1,.87,.68;%
Navy,0,0,.5;%
+NavyBlue,0,0,.5;%
OldLace,.992,.96,.9;%
Olive,.5,.5,0;%
OliveDrab,.42,.556,.136;%
@@ -6303,6 +7235,7 @@ Thistle,.848,.75,.848;%
Tomato,1,.39,.28;%
Turquoise,.25,.88,.815;%
Violet,.932,.51,.932;%
+VioletRed,.816,.125,.565;%
Wheat,.96,.87,.7;%
White,1,1,1;%
WhiteSmoke,.96,.96,.96;%
@@ -6310,6 +7243,327 @@ Yellow,1,1,0;%
YellowGreen,.604,.804,.196}
%</svgnames>
%
+%<*x11names>
+\preparecolorset{rgb}{}{}{%
+AntiqueWhite1,1,.936,.86;%
+AntiqueWhite2,.932,.875,.8;%
+AntiqueWhite3,.804,.752,.69;%
+AntiqueWhite4,.545,.512,.47;%
+Aquamarine1,.498,1,.83;%
+Aquamarine2,.464,.932,.776;%
+Aquamarine3,.4,.804,.668;%
+Aquamarine4,.27,.545,.455;%
+Azure1,.94,1,1;%
+Azure2,.88,.932,.932;%
+Azure3,.756,.804,.804;%
+Azure4,.512,.545,.545;%
+Bisque1,1,.894,.77;%
+Bisque2,.932,.835,.716;%
+Bisque3,.804,.716,.62;%
+Bisque4,.545,.49,.42;%
+Blue1,0,0,1;%
+Blue2,0,0,.932;%
+Blue3,0,0,.804;%
+Blue4,0,0,.545;%
+Brown1,1,.25,.25;%
+Brown2,.932,.23,.23;%
+Brown3,.804,.2,.2;%
+Brown4,.545,.136,.136;%
+Burlywood1,1,.828,.608;%
+Burlywood2,.932,.772,.57;%
+Burlywood3,.804,.668,.49;%
+Burlywood4,.545,.45,.332;%
+CadetBlue1,.596,.96,1;%
+CadetBlue2,.556,.898,.932;%
+CadetBlue3,.48,.772,.804;%
+CadetBlue4,.325,.525,.545;%
+Chartreuse1,.498,1,0;%
+Chartreuse2,.464,.932,0;%
+Chartreuse3,.4,.804,0;%
+Chartreuse4,.27,.545,0;%
+Chocolate1,1,.498,.14;%
+Chocolate2,.932,.464,.13;%
+Chocolate3,.804,.4,.112;%
+Chocolate4,.545,.27,.075;%
+Coral1,1,.448,.336;%
+Coral2,.932,.415,.312;%
+Coral3,.804,.356,.27;%
+Coral4,.545,.244,.185;%
+Cornsilk1,1,.972,.864;%
+Cornsilk2,.932,.91,.804;%
+Cornsilk3,.804,.785,.694;%
+Cornsilk4,.545,.532,.47;%
+Cyan1,0,1,1;%
+Cyan2,0,.932,.932;%
+Cyan3,0,.804,.804;%
+Cyan4,0,.545,.545;%
+DarkGoldenrod1,1,.725,.06;%
+DarkGoldenrod2,.932,.68,.055;%
+DarkGoldenrod3,.804,.585,.048;%
+DarkGoldenrod4,.545,.396,.03;%
+DarkOliveGreen1,.792,1,.44;%
+DarkOliveGreen2,.736,.932,.408;%
+DarkOliveGreen3,.635,.804,.352;%
+DarkOliveGreen4,.43,.545,.24;%
+DarkOrange1,1,.498,0;%
+DarkOrange2,.932,.464,0;%
+DarkOrange3,.804,.4,0;%
+DarkOrange4,.545,.27,0;%
+DarkOrchid1,.75,.244,1;%
+DarkOrchid2,.698,.228,.932;%
+DarkOrchid3,.604,.196,.804;%
+DarkOrchid4,.408,.132,.545;%
+DarkSeaGreen1,.756,1,.756;%
+DarkSeaGreen2,.705,.932,.705;%
+DarkSeaGreen3,.608,.804,.608;%
+DarkSeaGreen4,.41,.545,.41;%
+DarkSlateGray1,.592,1,1;%
+DarkSlateGray2,.552,.932,.932;%
+DarkSlateGray3,.475,.804,.804;%
+DarkSlateGray4,.32,.545,.545;%
+DeepPink1,1,.08,.576;%
+DeepPink2,.932,.07,.536;%
+DeepPink3,.804,.064,.464;%
+DeepPink4,.545,.04,.312;%
+DeepSkyBlue1,0,.75,1;%
+DeepSkyBlue2,0,.698,.932;%
+DeepSkyBlue3,0,.604,.804;%
+DeepSkyBlue4,0,.408,.545;%
+DodgerBlue1,.116,.565,1;%
+DodgerBlue2,.11,.525,.932;%
+DodgerBlue3,.094,.455,.804;%
+DodgerBlue4,.064,.305,.545;%
+Firebrick1,1,.19,.19;%
+Firebrick2,.932,.172,.172;%
+Firebrick3,.804,.15,.15;%
+Firebrick4,.545,.1,.1;%
+Gold1,1,.844,0;%
+Gold2,.932,.79,0;%
+Gold3,.804,.68,0;%
+Gold4,.545,.46,0;%
+Goldenrod1,1,.756,.145;%
+Goldenrod2,.932,.705,.132;%
+Goldenrod3,.804,.608,.112;%
+Goldenrod4,.545,.41,.08;%
+Green1,0,1,0;%
+Green2,0,.932,0;%
+Green3,0,.804,0;%
+Green4,0,.545,0;%
+Honeydew1,.94,1,.94;%
+Honeydew2,.88,.932,.88;%
+Honeydew3,.756,.804,.756;%
+Honeydew4,.512,.545,.512;%
+HotPink1,1,.43,.705;%
+HotPink2,.932,.415,.655;%
+HotPink3,.804,.376,.565;%
+HotPink4,.545,.228,.385;%
+IndianRed1,1,.415,.415;%
+IndianRed2,.932,.39,.39;%
+IndianRed3,.804,.332,.332;%
+IndianRed4,.545,.228,.228;%
+Ivory1,1,1,.94;%
+Ivory2,.932,.932,.88;%
+Ivory3,.804,.804,.756;%
+Ivory4,.545,.545,.512;%
+Khaki1,1,.965,.56;%
+Khaki2,.932,.9,.52;%
+Khaki3,.804,.776,.45;%
+Khaki4,.545,.525,.305;%
+LavenderBlush1,1,.94,.96;%
+LavenderBlush2,.932,.88,.898;%
+LavenderBlush3,.804,.756,.772;%
+LavenderBlush4,.545,.512,.525;%
+LemonChiffon1,1,.98,.804;%
+LemonChiffon2,.932,.912,.75;%
+LemonChiffon3,.804,.79,.648;%
+LemonChiffon4,.545,.536,.44;%
+LightBlue1,.75,.936,1;%
+LightBlue2,.698,.875,.932;%
+LightBlue3,.604,.752,.804;%
+LightBlue4,.408,.512,.545;%
+LightCyan1,.88,1,1;%
+LightCyan2,.82,.932,.932;%
+LightCyan3,.705,.804,.804;%
+LightCyan4,.48,.545,.545;%
+LightGoldenrod1,1,.925,.545;%
+LightGoldenrod2,.932,.864,.51;%
+LightGoldenrod3,.804,.745,.44;%
+LightGoldenrod4,.545,.505,.298;%
+LightPink1,1,.684,.725;%
+LightPink2,.932,.635,.68;%
+LightPink3,.804,.55,.585;%
+LightPink4,.545,.372,.396;%
+LightSalmon1,1,.628,.48;%
+LightSalmon2,.932,.585,.448;%
+LightSalmon3,.804,.505,.385;%
+LightSalmon4,.545,.34,.26;%
+LightSkyBlue1,.69,.888,1;%
+LightSkyBlue2,.644,.828,.932;%
+LightSkyBlue3,.552,.712,.804;%
+LightSkyBlue4,.376,.484,.545;%
+LightSteelBlue1,.792,.884,1;%
+LightSteelBlue2,.736,.824,.932;%
+LightSteelBlue3,.635,.71,.804;%
+LightSteelBlue4,.43,.484,.545;%
+LightYellow1,1,1,.88;%
+LightYellow2,.932,.932,.82;%
+LightYellow3,.804,.804,.705;%
+LightYellow4,.545,.545,.48;%
+Magenta1,1,0,1;%
+Magenta2,.932,0,.932;%
+Magenta3,.804,0,.804;%
+Magenta4,.545,0,.545;%
+Maroon1,1,.204,.7;%
+Maroon2,.932,.19,.655;%
+Maroon3,.804,.16,.565;%
+Maroon4,.545,.11,.385;%
+MediumOrchid1,.88,.4,1;%
+MediumOrchid2,.82,.372,.932;%
+MediumOrchid3,.705,.32,.804;%
+MediumOrchid4,.48,.215,.545;%
+MediumPurple1,.67,.51,1;%
+MediumPurple2,.624,.475,.932;%
+MediumPurple3,.536,.408,.804;%
+MediumPurple4,.365,.28,.545;%
+MistyRose1,1,.894,.884;%
+MistyRose2,.932,.835,.824;%
+MistyRose3,.804,.716,.71;%
+MistyRose4,.545,.49,.484;%
+NavajoWhite1,1,.87,.68;%
+NavajoWhite2,.932,.81,.63;%
+NavajoWhite3,.804,.7,.545;%
+NavajoWhite4,.545,.475,.37;%
+OliveDrab1,.752,1,.244;%
+OliveDrab2,.7,.932,.228;%
+OliveDrab3,.604,.804,.196;%
+OliveDrab4,.41,.545,.132;%
+Orange1,1,.648,0;%
+Orange2,.932,.604,0;%
+Orange3,.804,.52,0;%
+Orange4,.545,.352,0;%
+OrangeRed1,1,.27,0;%
+OrangeRed2,.932,.25,0;%
+OrangeRed3,.804,.215,0;%
+OrangeRed4,.545,.145,0;%
+Orchid1,1,.512,.98;%
+Orchid2,.932,.48,.912;%
+Orchid3,.804,.41,.79;%
+Orchid4,.545,.28,.536;%
+PaleGreen1,.604,1,.604;%
+PaleGreen2,.565,.932,.565;%
+PaleGreen3,.488,.804,.488;%
+PaleGreen4,.33,.545,.33;%
+PaleTurquoise1,.732,1,1;%
+PaleTurquoise2,.684,.932,.932;%
+PaleTurquoise3,.59,.804,.804;%
+PaleTurquoise4,.4,.545,.545;%
+PaleVioletRed1,1,.51,.67;%
+PaleVioletRed2,.932,.475,.624;%
+PaleVioletRed3,.804,.408,.536;%
+PaleVioletRed4,.545,.28,.365;%
+PeachPuff1,1,.855,.725;%
+PeachPuff2,.932,.796,.68;%
+PeachPuff3,.804,.688,.585;%
+PeachPuff4,.545,.468,.396;%
+Pink1,1,.71,.772;%
+Pink2,.932,.664,.72;%
+Pink3,.804,.57,.62;%
+Pink4,.545,.39,.424;%
+Plum1,1,.732,1;%
+Plum2,.932,.684,.932;%
+Plum3,.804,.59,.804;%
+Plum4,.545,.4,.545;%
+Purple1,.608,.19,1;%
+Purple2,.57,.172,.932;%
+Purple3,.49,.15,.804;%
+Purple4,.332,.1,.545;%
+Red1,1,0,0;%
+Red2,.932,0,0;%
+Red3,.804,0,0;%
+Red4,.545,0,0;%
+RosyBrown1,1,.756,.756;%
+RosyBrown2,.932,.705,.705;%
+RosyBrown3,.804,.608,.608;%
+RosyBrown4,.545,.41,.41;%
+RoyalBlue1,.284,.464,1;%
+RoyalBlue2,.264,.43,.932;%
+RoyalBlue3,.228,.372,.804;%
+RoyalBlue4,.152,.25,.545;%
+Salmon1,1,.55,.41;%
+Salmon2,.932,.51,.385;%
+Salmon3,.804,.44,.33;%
+Salmon4,.545,.298,.224;%
+SeaGreen1,.33,1,.624;%
+SeaGreen2,.305,.932,.58;%
+SeaGreen3,.264,.804,.5;%
+SeaGreen4,.18,.545,.34;%
+Seashell1,1,.96,.932;%
+Seashell2,.932,.898,.87;%
+Seashell3,.804,.772,.75;%
+Seashell4,.545,.525,.51;%
+Sienna1,1,.51,.28;%
+Sienna2,.932,.475,.26;%
+Sienna3,.804,.408,.224;%
+Sienna4,.545,.28,.15;%
+SkyBlue1,.53,.808,1;%
+SkyBlue2,.494,.752,.932;%
+SkyBlue3,.424,.65,.804;%
+SkyBlue4,.29,.44,.545;%
+SlateBlue1,.512,.435,1;%
+SlateBlue2,.48,.404,.932;%
+SlateBlue3,.41,.35,.804;%
+SlateBlue4,.28,.235,.545;%
+SlateGray1,.776,.888,1;%
+SlateGray2,.725,.828,.932;%
+SlateGray3,.624,.712,.804;%
+SlateGray4,.424,.484,.545;%
+Snow1,1,.98,.98;%
+Snow2,.932,.912,.912;%
+Snow3,.804,.79,.79;%
+Snow4,.545,.536,.536;%
+SpringGreen1,0,1,.498;%
+SpringGreen2,0,.932,.464;%
+SpringGreen3,0,.804,.4;%
+SpringGreen4,0,.545,.27;%
+SteelBlue1,.39,.72,1;%
+SteelBlue2,.36,.675,.932;%
+SteelBlue3,.31,.58,.804;%
+SteelBlue4,.21,.392,.545;%
+Tan1,1,.648,.31;%
+Tan2,.932,.604,.288;%
+Tan3,.804,.52,.248;%
+Tan4,.545,.352,.17;%
+Thistle1,1,.884,1;%
+Thistle2,.932,.824,.932;%
+Thistle3,.804,.71,.804;%
+Thistle4,.545,.484,.545;%
+Tomato1,1,.39,.28;%
+Tomato2,.932,.36,.26;%
+Tomato3,.804,.31,.224;%
+Tomato4,.545,.21,.15;%
+Turquoise1,0,.96,1;%
+Turquoise2,0,.898,.932;%
+Turquoise3,0,.772,.804;%
+Turquoise4,0,.525,.545;%
+VioletRed1,1,.244,.59;%
+VioletRed2,.932,.228,.55;%
+VioletRed3,.804,.196,.47;%
+VioletRed4,.545,.132,.32;%
+Wheat1,1,.905,.73;%
+Wheat2,.932,.848,.684;%
+Wheat3,.804,.73,.59;%
+Wheat4,.545,.494,.4;%
+Yellow1,1,1,0;%
+Yellow2,.932,.932,0;%
+Yellow3,.804,.804,0;%
+Yellow4,.545,.545,0;%
+Gray0,.745,.745,.745;%
+Green0,0,1,0;%
+Grey0,.745,.745,.745;%
+Maroon0,.69,.19,.376;%
+Purple0,.628,.125,.94}
+%</x11names>
+%
%<*test1>
\documentclass[a4paper]{article}
@@ -6488,7 +7742,7 @@ YellowGreen,.604,.804,.196}
\begin{figure}[htb]\caption{Modified version of an example from the \textsf{pstricks} manual; requires \textsf{pst-tree}}
\begin{SideBySideExample}[fontsize=\footnotesize,xrightmargin=.45\textwidth]
- \begin{pspicture}[.5](-0.5,-2)(3,2)
+ \begin{pspicture}(-0.5,-2)(3,2)
\cnode(0,0){.5cm}{root}
\cnode*[linecolor=red](3,1.5){4pt}{A}
\cnode*[linecolor=red!72.5375!blue](3,0){4pt}{B}
@@ -6554,8 +7808,8 @@ YellowGreen,.604,.804,.196}
\begin{Example}[fontsize=\footnotesize,xrightmargin=.45\textwidth]
\newcount\WL \unitlength.75pt
\def\WaveToPS#1%
- {\definecolor{tmp}{wave}{#1}\extractcolorspec{tmp}\tmp
- \expandafter\convertcolorspec\tmp{rgb}\tmp \expandafter\WaveToPSi\tmp,}
+ {\definecolor{tmp}{rgb:wave}{#1}\extractcolorspecs{tmp}\tmpm\tmpc
+ \expandafter\WaveToPSi\tmpc,}
\def\WaveToPSi#1,#2,#3,{\pstVerb{/Red{#1}def /Green{#2}def /Blue{#3}def}}
\def\DisplayBar#1#2%
{\linethickness{1.25\unitlength}\WL=360
@@ -6587,8 +7841,15 @@ YellowGreen,.604,.804,.196}
%
%<*test3>
\listfiles
-\documentclass{article}
-\usepackage[table,dvipsnames]{xcolor}[2005/03/24]
+\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
@@ -6599,40 +7860,132 @@ YellowGreen,.604,.804,.196}
\parindent0pt
\pagecolor{gray!25}
+\definecolors{JungleGreen,DarkOrchid}
+
\begin{document}
-\title{Color extensions with the \textsf{xcolor} package --- log file example}
-\author{Dr. Uwe Kern\thanks{This file is part of the \textsf{xcolor} distribution which can be downloaded from the CTAN mirrors (\texttt{macros/latex/contrib/xcolor/}) or the homepage \texttt{www.ukern.de/tex/xcolor.html}. Please send error reports and suggestions for improvements to \texttt{xcolor@ukern.de}.}}
-\date{\XCfileversion{} (\XCfiledate)}
+\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 \texttt{\href{mailto:xcolor@ukern.de}{xcolor@ukern.de}}.}}
\maketitle
-The purpose of this file is to demonstrate the logging facilities of the \textsf{xcolor} package.
+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.
-\bigskip
-Table example:
-\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{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
+\pagecolor{white}
+
+\section{Color definition and application}
-\bigskip
\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
@@ -6661,16 +8014,29 @@ Test\test\test\test\test\test\test Test
\def\test{\hbox to 1em{{\color{foo!![2]}\vrule width 1em height 1.5ex}}}
Test\test\test\test\test\test\test Test
-\bigskip
-\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
+\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
@@ -6679,43 +8045,119 @@ Type test:
\@namedef{\string\color@foo4}{\xcolor@{}{}{foo4}{}}\edef\tempd{\XC@type{foo4}}\tempd
\makeatother
-\textcolor{rgb:red!50,4;green!25,2}{Extended color expression (rgb:red!50,4;green!25,2)}.
-
\end{document}
%</test3>
%
%<*test4>
\listfiles
\documentclass[a4paper]{article}
+%%\PassOptionsToPackage{dvipdf}{xcolor}
+%%\PassOptionsToPackage{dvipdfm}{xcolor}
+%%\PassOptionsToPackage{dvipdfmx}{xcolor}
+%%\PassOptionsToPackage{dvips}{xcolor}
+%%\PassOptionsToPackage{dvipsone}{xcolor}
+%%\PassOptionsToPackage{dviwin}{xcolor}
+%%\PassOptionsToPackage{dviwindo}{xcolor}
+%%\PassOptionsToPackage{emtex}{xcolor}
+%%\PassOptionsToPackage{oztex}{xcolor}
+%%\PassOptionsToPackage{pctex32}{xcolor}
+%%\PassOptionsToPackage{pctexhp}{xcolor}
+%%\PassOptionsToPackage{pctexps}{xcolor}
+%%\PassOptionsToPackage{pctexwin}{xcolor}
+%%\PassOptionsToPackage{pdftex}{xcolor}
+%%\PassOptionsToPackage{tcidvi}{xcolor}
+%%\PassOptionsToPackage{textures}{xcolor}
+%%\PassOptionsToPackage{truetex}{xcolor}
+%%\PassOptionsToPackage{vtex}{xcolor}
+%%\PassOptionsToPackage{xdvi}{xcolor}
+%%\PassOptionsToPackage{xetex}{xcolor}
+%%\PassOptionsToPackage{prologue}{xcolor}
+%%\PassOptionsToPackage{kernelfbox}{xcolor}
+%%\PassOptionsToPackage{xcdraw}{xcolor}
+\usepackage[emtex]{graphics}
\usepackage{xcolor}
-%%\usepackage[dvipdf]{xcolor}
-%%\usepackage[dvipdfm]{xcolor}
-%%\usepackage[dvipdfmx]{xcolor}
-%%\usepackage[dvips]{xcolor}
-%%\usepackage[dvipsone]{xcolor}
-%%\usepackage[dviwin]{xcolor}
-%%\usepackage[emtex]{xcolor}
-%%\usepackage[pctex32]{xcolor}
-%%\usepackage[pctexhp]{xcolor}
-%%\usepackage[pctexps]{xcolor}
-%%\usepackage[pctexwin]{xcolor}
-%%\usepackage[pdftex]{xcolor}
-%%\usepackage[tcidvi]{xcolor}
-%%\usepackage[textures]{xcolor}
-%%\usepackage[truetex]{xcolor}
-%%\usepackage[vtex]{xcolor}
-%%\usepackage[xetex]{xcolor}
-%%\usepackage[dviwindo]{xcolor}
-%%\usepackage[oztex]{xcolor}
-%%\usepackage[xdvi]{xcolor}
\usepackage[margin=1.25cm,noheadfoot]{geometry}
\pagestyle{empty}
\parindent0pt
\nofiles
\let\familydefault\sfdefault
+\makeatletter
+%% special code for driver list construction via
+%% latex \def\xcdriverlist{1}\input{xcolor4}
+%% writes list in file xcolor4.tmp
+\@ifundefined{xcdriverlist}{}{%
+%% optional * (skips test whether #1.def exists)
+%% #1 = driver
+%% #2 = additional options (stored in \options@#2)
+%% #3 = processor 1
+%% #4 = output format 1
+%% #5 = processor 2
+%% #6 = output format 2
+%% #7 = processor 3
+%% #8 = output format 3
+\def\0{\@ifstar
+ {\def\@@tmp####1{\@firstoftwo}\1}{\def\@@tmp####1{\IfFileExists{####1.def}}\1}}
+\def\1#1#2#3#4#5#6#7#8{\@@tmp{#1}%
+ {\XC@let@Nc\@@tmp{options@#2}
+ \ifx\@@tmp\@empty\else
+ \edef\@@tmp{,\@@tmp}\XC@replace\@@tmp,{;#1-}\XC@replace\@@tmp;,
+ \fi
+ \edef\@@tmp{:=#1\@@tmp}
+ \expandafter\@for\expandafter\@tempa\@@tmp\do
+ {\let\@@tmp\@tempa\XC@replace\@@tmp-,
+ \edef\@@tmp{\@tempa\space\string\PassOptionsToPackage{\@@tmp}{xcolor}}
+ \@namexdef{list@#4}{\@nameuse{list@#4},#3 \@@tmp}
+ \@namexdef{list@#6}{\@nameuse{list@#6},#5 \@@tmp}
+ \@namexdef{list@#8}{\@nameuse{list@#8},#7 \@@tmp}}}%
+ {\typeout{No file `#1.def' found.}}}
+\def\list@{}
+\def\list@dvi{}
+\def\list@ps{}
+\def\list@pdf{}
+\@namedef{options@0}{}
+\@namedef{options@1}{kernelfbox,prologue,xcdraw,kernelfbox-xcdraw,prologue-xcdraw}
+\0{dvips}1{latex}{dvi}{dvips}{ps}{ps2pdf}{pdf}
+\0{pctex32}0{latex}{dvi}{dvips}{ps}{ps2pdf}{pdf}
+\0{dvipdf}0{latex}{dvi}{dvipdf}{pdf}{}{}
+\0{dvipdfm}1{latex}{dvi}{dvipdfm}{pdf}{}{}
+\0{dvipdfmx}0{latex}{dvi}{dvipdfmx}{pdf}{}{}
+\0{dvipsone}0{latex}{dvi}{}{}{}{}
+\0{dviwin}0{latex}{dvi}{}{}{}{}
+\0*{dviwindo}0{latex}{dvi}{}{}{}{}
+\0{emtex}0{latex}{dvi}{}{}{}{}
+\0*{oztex}0{latex}{dvi}{}{}{}{}
+\0{pctexhp}0{latex}{dvi}{}{}{}{}
+\0{pctexps}0{latex}{dvi}{}{}{}{}
+\0{pctexwin}0{latex}{dvi}{}{}{}{}
+\0{tcidvi}0{latex}{dvi}{}{}{}{}
+\0{textures}0{latex}{dvi}{}{}{}{}
+\0{truetex}0{latex}{dvi}{}{}{}{}
+\0*{xdvi}0{latex}{dvi}{}{}{}{}
+\0{pdftex}1{pdflatex}{pdf}{}{}{}{}
+\0{vtex}0{vlatex}{pdf}{}{}{}{}
+\0{xetex}0{xelatex}{pdf}{}{}{}{}
+\newwrite\@tempa\immediate\openout\@tempa=\jobname.tmp
+\@tfor\@tempb:={dvi}{ps}{pdf}\do
+ {\edef\@@tmp{\@nameuse{list@\@tempb}}\edef\@@tmp{:=\expandafter\@gobble\@@tmp}
+ \expandafter\@for\expandafter\@@tmp\@@tmp\do
+ {\immediate\write\@tempa{\@@tmp}}}
+\immediate\closeout\@tempa
+\@@end}% end of driver list construction code
+\edef\Options{\expandafter\@gobble\XC@@opt}
+\@tfor\@@tmp:={dvipdf}{dvipdfm}{dvipdfmx}{dvips}{dvipsone}{dviwin}{dviwindo}%
+ {emtex}{oztex}{pctex32}{pctexhp}{pctexps}{pctexwin}{pdftex}%
+ {tcidvi}{textures}{truetex}{vtex}{xdvi}{xetex}%
+ {natural}{table}{fixpdftex}{hyperref}{showerrors}{hideerrors}%
+ {override}{usenames}{nodvipsnames}{debugshow}\do
+ {\expandafter\XC@replace\expandafter\Options\expandafter{\@@tmp,}{}}
+\edef\Options{\XC@@drv,\Options}
+\def\@@tmp#1,#2%
+ {\ifx,#2#1\expandafter\remove@to@nnil\else#1', `\expandafter\@@tmp\fi#2}
+\edef\Options{`\expandafter\@@tmp\Options,,\@nnil'}
+\makeatother
\begin{document}
\vbox to\textheight{\vss\centering
-{\Large\textbf{xcolor} driver test: `\csname XC@@drv\endcsname'}
+{\Large\textbf{xcolor} driver test: \Options}
\vskip0.5cm
\begin{testcolors}[rgb,hsb,cmyk,gray,HTML]
\testcolor{magenta}
@@ -6729,35 +8171,30 @@ Type test:
\testcolor[hsb]{0.66667,1,1}
\testcolor[cmyk]{1,1,0,0}
\testcolor[gray]{0.11}
-\testcolor[wave]{440}
\noalign{\medskip}
\testcolor{cyan}
\testcolor[rgb]{0,1,1}
\testcolor[hsb]{0.5,1,1}
\testcolor[cmyk]{1,0,0,0}
\testcolor[gray]{0.7}
-\testcolor[wave]{490}
\noalign{\medskip}
\testcolor{green}
\testcolor[rgb]{0,1,0}
\testcolor[hsb]{0.33333,1,1}
\testcolor[cmyk]{1,0,1,0}
\testcolor[gray]{0.59}
-\testcolor[wave]{510}
\noalign{\medskip}
\testcolor{yellow}
\testcolor[rgb]{1,1,0}
\testcolor[hsb]{0.16667,1,1}
\testcolor[cmyk]{0,0,1,0}
\testcolor[gray]{0.89}
-\testcolor[wave]{580}
\noalign{\medskip}
\testcolor{red}
\testcolor[rgb]{1,0,0}
\testcolor[hsb]{0,1,1}
\testcolor[cmyk]{0,1,1,0}
\testcolor[gray]{0.3}
-\testcolor[wave]{645}
\noalign{\medskip}
\testcolor{black}
\testcolor[rgb]{0,0,0}
@@ -6776,6 +8213,11 @@ Type test:
\testcolor[hsb]{0,0,1}
\testcolor[cmyk]{0,0,0,0}
\testcolor[gray]{1}
+\noalign{\medskip\smallskip}
+f(color)box &
+\multicolumn5{c}{\def\i{\fbox{\a}}\def\ii{\fcolorbox{red}{yellow}{\a}}\def\iii{\scalebox{3}}%
+\def\a{{\setbox0=\hbox to3ex{\hss\textcolor{blue}{\vrule width .75ex height1.5ex depth1.5ex}\hss}\ht0=0pt\dp0=0pt\box0}}%
+\fboxsep0.333ex \i\quad\ii\quad\iii\i\quad\iii\ii\quad\fboxrule.75ex \iii\i\quad\iii\ii}
\end{testcolors}
\vskip0.5cm
{\footnotesize This table was generated with \textbf{xcolor4.tex} which is part of the \textbf{xcolor} package \XCfileversion{} (\XCfiledate) by Uwe Kern.}