0% found this document useful (0 votes)
41 views66 pages

Xcolor

The xcolor package enhances LATEX's color capabilities by providing a driver-independent method for accessing various colors, tints, shades, and mixes through color expressions. It supports document-wide target color models, automatic color schemes, and offers tools for color blending, separation, and conversion among twelve color models. The document includes detailed instructions on installation, usage, and examples of color applications.

Uploaded by

leto.cave
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views66 pages

Xcolor

The xcolor package enhances LATEX's color capabilities by providing a driver-independent method for accessing various colors, tints, shades, and mixes through color expressions. It supports document-wide target color models, automatic color schemes, and offers tools for color blending, separation, and conversion among twelve color models. The document includes detailed instructions on installation, usage, and examples of color applications.

Uploaded by

leto.cave
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

Extending LATEX’s color facilities: the xcolor

package

Dr. Uwe Kern



v3.02 (2024/09/29)

Abstract
xcolor provides easy driver-independent access to several kinds of colors,
tints, shades, tones, and mixes of arbitrary colors by means of color expres-
sions like \color{red!50!green!20!blue}. It allows to select a document-
wide target color model and offers tools for automatic color schemes, conver-
sion between twelve color models, alternating table row colors, color blending
and masking, color separation, and color wheel calculations.

Contents
1 Introduction 4
1.1 Purpose of this package . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Color tints, shades, tones, and complements . . . . . . . . . . . . . 5
1.3 Color models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Color wheels and color harmony . . . . . . . . . . . . . . . . . . . 5

2 The User Interface 7


2.1 Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.1 Package installation . . . . . . . . . . . . . . . . . . . . . . 7
2.1.2 Package options . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.3 Executing additional initialisation commands . . . . . . . . 8
2.2 Color models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.1 Supported color models . . . . . . . . . . . . . . . . . . . . 8
2.2.2 Substituting individual color models . . . . . . . . . . . . . 11
2.2.3 Changing the target color model within a document . . . . 11
2.3 Arguments and terminology . . . . . . . . . . . . . . . . . . . . . . 12
2.3.1 Additional remarks and restrictions on arguments . . . . . 12
2.3.2 Meaning of standard color expressions . . . . . . . . . . . . 15
2.3.3 Meaning of extended color expressions . . . . . . . . . . . . 16
2.3.4 Color functions . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.4 Predefined colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.4.1 Colors that are always available . . . . . . . . . . . . . . . . 17
∗ This package can be downloaded from CTAN/macros/latex/contrib/xcolor/. There is also

an xcolor homepage: www.ukern.de/tex/xcolor.html. Please send error reports and suggestions


for improvements to: https://github.com/latex3/xcolor/issues.

1
xcolor v3.02 (2024/09/29) 2

2.4.2 Additional sets of colors . . . . . . . . . . . . . . . . . . . . 17


2.5 Color definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.5.1 Ordinary and named colors . . . . . . . . . . . . . . . . . . 18
2.5.2 Color definition in xcolor . . . . . . . . . . . . . . . . . . . . 19
2.5.3 Defining sets of colors . . . . . . . . . . . . . . . . . . . . . 20
2.5.4 Immediate and deferred definitions . . . . . . . . . . . . . . 20
2.5.5 Global color definitions . . . . . . . . . . . . . . . . . . . . 21
2.6 Color application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.6.1 Standard color commands . . . . . . . . . . . . . . . . . . . 22
2.6.2 Colored boxes . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.6.3 Colors in math . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.6.4 Using the current color . . . . . . . . . . . . . . . . . . . . 23
2.6.5 Color testing . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.7 Color blending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.8 Color masks and separation . . . . . . . . . . . . . . . . . . . . . . 24
2.9 Color series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.9.1 Definition of a color series . . . . . . . . . . . . . . . . . . . 25
2.9.2 Initialisation of a color series . . . . . . . . . . . . . . . . . 26
2.9.3 Application of a color series . . . . . . . . . . . . . . . . . . 27
2.9.4 Differences between colors and color series . . . . . . . . . . 27
2.10 Border colors for hyperlinks . . . . . . . . . . . . . . . . . . . . . . 27
2.11 Additional color specification in the pstricks world . . . . . . . . . 28
2.12 Color in tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.13 Color information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.14 Color conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.15 Problems and solutions . . . . . . . . . . . . . . . . . . . . . . . . 30
2.15.1 Name clashs between dvipsnames and svgnames . . . . . . 30
2.15.2 Change color of included .eps file . . . . . . . . . . . . . . 30

3 Examples 31

4 Colors by Name 38
4.1 Base colors (always available) . . . . . . . . . . . . . . . . . . . . . 38
4.2 Colors via dvipsnames option . . . . . . . . . . . . . . . . . . . . . 38
4.3 Colors via svgnames option . . . . . . . . . . . . . . . . . . . . . . 38
4.4 Colors via x11names option . . . . . . . . . . . . . . . . . . . . . . 39

5 Technical Supplement 41
5.1 Color models supported by drivers . . . . . . . . . . . . . . . . . . 41
5.2 How xcolor handles driver-specific color models . . . . . . . . . . . 41
5.3 Behind the scenes: internal color representation . . . . . . . . . . . 42
5.4 A remark on accuracy . . . . . . . . . . . . . . . . . . . . . . . . . 42

6 The Formulas 44
6.1 Color mixing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.2 Conversion between integer and real models . . . . . . . . . . . . . 44
6.2.1 Real to integer conversion . . . . . . . . . . . . . . . . . . . 46
6.2.2 Integer to real conversion . . . . . . . . . . . . . . . . . . . 46
6.3 Color conversion and complements . . . . . . . . . . . . . . . . . . 47
6.3.1 The rgb model . . . . . . . . . . . . . . . . . . . . . . . . . 47
xcolor v3.02 (2024/09/29) 3

6.3.2 The cmy model . . . . . . . . . . . . . . . . . . . . . . . . . 50


6.3.3 The cmyk model . . . . . . . . . . . . . . . . . . . . . . . . 51
6.3.4 The hsb model . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.3.5 The Hsb model . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.3.6 The tHsb model . . . . . . . . . . . . . . . . . . . . . . . . 53
6.3.7 The gray model . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.3.8 The RGB model . . . . . . . . . . . . . . . . . . . . . . . . 54
6.3.9 The HTML model . . . . . . . . . . . . . . . . . . . . . . . 54
6.3.10 The HSB model . . . . . . . . . . . . . . . . . . . . . . . . 54
6.3.11 The Gray model . . . . . . . . . . . . . . . . . . . . . . . . 54
6.3.12 The wave model . . . . . . . . . . . . . . . . . . . . . . . . 55

References 57

Appendix 58
Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Known Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

Index 64

List of Tables
1 Package options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2 Package loading order . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 Supported color models . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Arguments and terminology . . . . . . . . . . . . . . . . . . . . . . 13
5 Drivers and color models . . . . . . . . . . . . . . . . . . . . . . . . 41
6 Driver-dependent internal color representation . . . . . . . . . . . . 43
7 Color constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
8 Color conversion pairs . . . . . . . . . . . . . . . . . . . . . . . . . 45

List of Figures
1 Color spectrum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2 Color testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3 Progressing from one to another color . . . . . . . . . . . . . . . . 32
4 Target color model . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5 Standard color expressions . . . . . . . . . . . . . . . . . . . . . . . 33
6 Standard color expressions . . . . . . . . . . . . . . . . . . . . . . . 33
7 Current color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
8 Color series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
9 Color masking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
10 Alternating row colors in tables: \rowcolors vs. \rowcolors* . . 35
11 Hsb and tHsb: hue◦ in 15◦ steps . . . . . . . . . . . . . . . . . . . 36
12 Color harmony . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
xcolor v3.02 (2024/09/29) 4

1 Introduction
1.1 Purpose of this package
The color package provides a powerful and stable tool for handling colors within
(pdf)LATEX in a consistent and driver-independent way, supporting several color
models (slightly less driver-independent).
Nevertheless, it is sometimes a bit clumsy to use, especially in cases where slight
color variations, color mixes or color conversions are involved: this usually implies
the usage of another program that calculates the necessary parameters, which are
then copied into a \definecolor command in LATEX. Quite often, also a pocket
calculator is involved in the treatment of issues like the following:
• My company has defined a corporate color, and the printing office tells me
how expensive it is to use more than two colors in our new brochure, whereas
all kinds of tints (e.g., a 75% version) of our color can be used at no extra
cost. But how to access these color variations in LATEX?
(Answer: \color{CorporateColor!75} etc.)
• My friend uses a nice color which I would like to apply in my own documents;
unfortunately, it is defined in the hsb model which is not supported in my
favorite application pdfLATEX. What to do now?
(Answer: just use the hsb definitions, xcolor will do the necessary calcula-
tions)
• How does a mixture of 40% green and 60% yellow look like?
(Answer: 40% + 60% = , e.g., \color{green!40!yellow})

• And how does its complementary color look like?


(Answer: , accessible via \color{-green!40!yellow})
• Now I want to mix three parts of the last color with two parts of its com-
plement and one part of red. How does that look?
(Answer: 3× +2× +1× = , the last color being accessible
via \color{rgb:-green!40!yellow,3;green!40!yellow,2;red,1})
• I know that light waves of 485nm are within the visible range. But which
color do they represent?
(Answer: approximately , via \color[wave]{485})

• My printing office wants all color definitions in my document to be trans-


formed into the cmyk model. How can I do the calculations efficiently?
(Answer: \usepackage[cmyk]{xcolor} or \selectcolormodel{cmyk})
• I have a table with 50 rows. How can I get alternating colors for entire rows
without copying 50 \rowcolor commands? The alternating scheme should
start in the 3rd row.
(Answer: something like \rowcolors{3}{OddColor}{EvenColor})
These are some of the issues solved by the xcolor package. Its purpose can be
summarized as to maintain the characteristics of color, while providing additional
features and flexibility with (hopefully) easy-to-use interfaces.
xcolor v3.02 (2024/09/29) 5

1.2 Color tints, shades, tones, and complements


According to [15] we define the terms
• tint: a color with white added,
• shade: a color with black added,
• tone: a color with gray added.
These are special cases of a general function mix(C, C ′ , p) which constructs a new
color, consisting of p parts of color C and 1 − p parts of color C ′ , where 0 ≤ p ≤ 1.
Thus, we set

tint(C, p) := mix(C, white, p) (1)


shade(C, p) := mix(C, black, p) (2)
tone(C, p) := mix(C, gray, p) (3)

where white, black, and gray are model-specific constants, see table 7 on page 45.
Further we define the term
• complement: a color C ∗ that yields white if superposed with the original
color C,
knowing that there are also different concepts of complementarity in place (e.g.,
opposite colors on color wheels). See section 6.3 on page 47 for calculation details
and section 1.4 for some remarks on color wheels.

1.3 Color models


A color model is a tool to describe or represent a certain set of colors in a way
that is suitable for the desired target device, e.g., a screen or a printer. There
are proprietary models (like Pantone or HKS) that provide finite sets of colors
(often called spot colors), where the user has to choose from without caring about
parametrisations; on the other hand, there are parameter-driven models like gray,
rgb, and cmyk, that aim to represent large finite or even (theoretically) infinite
sets of colors, built on very small subsets of base colors and rules, how to construct
other colors from these base colors. For example, a large range of colors can be
constructed by linear combinations of the base colors red, green, and blue. On
the other hand, usually spot colors can only be approximated by parameter values
in models like cmyk or rgb; the original colors are being physically mixed even
dependent on the targeted kind of paper. Finally, there are certain colors like gold
and silver that are hardly reproducible by any parameter-driven color model on
standard ink or laser printers.

1.4 Color wheels and color harmony


There has been a long history of placing colors (hues) on wheels in order to discuss
theoretical or practical color issues (e.g., Isaac Newton, 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
xcolor v3.02 (2024/09/29) 6

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.

Typical color wheel construction First, three primary colors are placed at
0◦ , 120◦ , 240◦ (artists often choose red, yellow, blue, whereas color scientists might
prefer red, green, blue). Next, three secondary colors are put at 60◦ , 180◦ , 300◦ .
Then, six tertiary colors may be placed in between (30◦ , 90◦ , . . . ). This is why
color wheels are frequently described to consist of twelve equidistant colors, al-
though the algorithm can be repeated arbitrarily often.

Color harmonies derived from a wheel We start with an arbitrary color


wheel:
• complementary colors have a distance of 180◦ on the wheel,
• color triads consist of three colors in 120◦ steps,
• color tetrads consist of four colors in 90◦ steps.

We assume now that the wheel is partitioned into 2n sectors of equal size:
• split complementary colors of a given color are the two immediate neigh-

bours of its complementary color, characterised by the positions n±1
2n · 360 ,

• analogous colors to a given color are its two or four neighbours, charac-
1
terised by the positions ± 2n · 360◦ and ± 2n
2
· 360◦ .

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 12 on page 37.
xcolor v3.02 (2024/09/29) 7

2 The User Interface


2.1 Preparation
2.1.1 Package installation
First of all, put xcolor.sty and all the .def files to some place where (pdf)LATEX
finds them. A typical place according to the TEX Directory Structure (TDS)
would be the directory texmf/tex/latex/xcolor, where texmf denotes the main
directory of your TEX installation. Additionally, put xcolor.pro to a place where
dvips finds it, typically texmf/dvips/xcolor. Usually, you will have to run some
kind of filename database update in order to make the files known and quickly
searchable to the TEX system. Then simply use xcolor (instead of color) in your
document. Thus, the general command is \usepackage[⟨options⟩]{xcolor} in
the document preamble. Table 2 on page 10 shows what has to be taken into
account with respect to the package loading order.

2.1.2 Package options


In general, there are several types of options:
• options that determine the color driver as explained in [5] and [6], currently:
dvips, xdvi, dvipdf, dvipdfm, dvipdfmx, luatex, pdftex, dvipsone,
dviwindo, emtex, dviwin, oztex, textures, pctexps, pctexwin, pctexhp,
pctex32, truetex, tcidvi, vtex, xetex, dvisvgm,
• options that determine the target color model1 (natural, rgb, cmy, cmyk,
hsb, gray, RGB, HTML, HSB, Gray) or disable colored output (monochrome),

• options that control whether and how certain sets of predefined colors are
being loaded: dvipsnames, dvipsnames*, svgnames, svgnames*, x11names,
x11names*,
• option that determine which other packages are to be loaded or supported:
table,

• options that influence the behaviour of other commands: prologue,


kernelfbox, xcdraw, noxcdraw, fixinclude, showerrors, hideerrors,
• obsolete options: pst, override, usenames, nodvipsnames, fixpdftex,
hyperref.

All available package options (except driver selection and obsolete options) are
\GetGinDriver listed in table 1 on page 9. In order to facilitate the co-operation with the hyperref
\GinDriver package, there is a command \GetGinDriver2 that grabs the driver actually used
and puts it into the command \GinDriver. The latter can then be used within
hyperref (or other packages), see the code example on page 11. If there is no
corresponding hyperref option, hypertex will be taken as default.
Warning: there is a substantial difference between xcolor and color regarding
how the dvips option is being handled. The color package implicitly invokes
1 Section 2.2.3 on page 11 explains how this setting can be overridden at any point in a

document.
2 This command is executed automatically if the package option hyperref is used.
xcolor v3.02 (2024/09/29) 8

the dvipsnames option, whenever one of the dvips, oztex, xdvi drivers is se-
lected. This makes documents less portable, since whenever one of these colors is
used without explicit dvipsnames option, other drivers like pdftex will issue error
messages because of unknown colors. Therefore, xcolor always requires an explicit
dvipsnames option to use these names — which then works for all drivers.

2.1.3 Executing additional initialisation commands


\xcolorcmd Here is a simple interface to pass commands that should be executed at the end
of the xcolor package (immediately before the initialising \color{black} is ex-
ecuted). Just say \def\xcolorcmd{⟨commands⟩} at some point before xcolor is
loaded.
Example: assuming that a.tex is a complete LATEX document, a command
like ‘latex \def\xcolorcmd{\colorlet{black}{red}}\input{a}’ at the con-
sole generates a file a.dvi with all occurrences of black being replaced by 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.)

2.2 Color models


2.2.1 Supported color models
The list of supported color models and their parameter ranges is given in table 3
on page 10. 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} (foo) or
\textcolor[HTML]{AFFE90}{foo} (foo).

rgb, cmyk, hsb, gray These are the models supported by PostScript directly.
We therefore refer to [1] for a description of their properties and relations. There is
\adjustUCRBG a special command to fine-tune the mechanisms of undercolor-removal and black-
generation during conversion to the cmyk model, see section 6.3.2 on page 50 for
details.

cmy This is mainly a model for intermediary calculation steps. With respect to
that, it is a simple complement of rgb. As far as visualisation is concerned, cmy
is treated as cmyk with k = 0.

HTML This is a model derived from rgb in order to enable input of color pa-
rameters 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 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 HTML will always consist of numbers and uppercase letters.

Hsb, tHsb Firstly, Hsb is a ‘user interface’ model, mapping hue ∈ [0, 1] onto
\rangeHsb hue◦ ∈ [0, H], where H is given by \def\rangeHsb{⟨H ⟩}. Thus, if H = 360,
we can think of a circle or wheel to specify the hue◦ parameter. Secondly,
Hsb is the basis for tHsb, also named tuned Hsb, which enables the user
xcolor v3.02 (2024/09/29) 9

Table 1: Package options

Option Description
natural (Default.) Keep all colors in their model, except RGB (converted
to rgb), HSB (converted to hsb), and Gray (converted to gray).
rgb Convert all colors to the rgb model.
cmy Convert all colors to the cmy model.
cmyk Convert all colors to the cmyk model.
hsb Convert all colors to the hsb model.
gray Convert all colors to the gray model. Especially useful to simulate
how a black & white printer will output the document.
RGB Convert all colors to the RGB model (and afterwards to rgb).
HTML Convert all colors to the HTML model (and afterwards to rgb).
HSB Convert all colors to the HSB model (and afterwards to hsb).
Gray Convert all colors to the Gray model (and afterwards to gray).
dvipsnames, dvipsnames* Load a set of predefined colors.1
svgnames, svgnames* Load a set of predefined colors according to SVG 1.1.1
x11names, x11names* Load a set of predefined colors according to Unix/X11.1
table Load the colortbl package, in order to use the tools for coloring
rows, columns, and cells within tables.
fixpdftex This option is obsolete and does nothing at all.
hyperref Support the hyperref package in terms of color expressions by
defining additional keys (see section 2.10 on page 27).
prologue Write prologue information to .xcp file for every color definition
(as described in section 2.5.1 on page 18).
kernelfbox Use LATEX kernel method to draw \f(rame)box frames2 .
xcdraw Use driver-specific commands to draw frames and color boxes.2
noxcdraw (Default.) Use generic code to draw frames and color boxes.2
fixinclude Prevent dvips color reset before .eps file inclusion (see section
2.15.2 on page 30).
showerrors (Default.) Display an error message if an undefined color is being
used (same behaviour as in the original color package).
hideerrors Display only a warning if an undefined color is being used, and
replace this color by black.
1 2
See section 2.4.2 on page 17. See section 2.6.2 on page 22.
xcolor v3.02 (2024/09/29) 10

Table 2: Package loading order

Action/Package colortbl hyperref pstricks color pstcol


load before xcolor allowed allowed allowed1 no no
load with xcolor option table — — — —
load after xcolor allowed allowed allowed no no
1
pstricks loads xcolor by default

Table 3: Supported color models

Name Base colors/notions Parameter range Default


3
rgb red, green, blue [0, 1]
3
cmy cyan, magenta, yellow [0, 1]
4
cmyk cyan, magenta, yellow, black [0, 1]
3
hsb hue, saturation, brightness [0, 1]
2
Hsb hue◦, saturation, brightness [0, H] × [0, 1] H = 360
2
tHsb hue◦, saturation, brightness [0, H] × [0, 1] H = 360
gray gray [0, 1]
RGB Red, Green, Blue {0, 1, . . . , L}3 L = 255
HTML RRGGBB {000000, . . . , FFFFFF}
HSB Hue, Saturation, Brightness {0, 1, . . . , M }3 M = 240
Gray Gray {0, 1, . . . , N } N = 15
wave lambda (nm) [363, 814]
L, M, N are positive integers; H is a positive real number

to apply a piecewise linear transformation on hue◦ by shifting selected hue◦


values forward or backward on the circle. This transformation is defined by
\rangetHsb \def\rangetHsb{x1 , y1 ; x2 , y2 ; . . . } which specifies that hue◦ = x1 in tHsb means
hue◦ = y1 in Hsb, etc. For example, yellow is at 60◦ in the Hsb circle (red being at
0◦ ), however, in most color wheels used by artists, yellow is at 120◦ . Therefore, a
‘120,60’ entry would make sense if we planned to replicate an artist’s color wheel
via tHsb. See section 6.3.6 on page 53 for the exact transformation formula and
further restrictions, and section 1.4 on page 5 for color wheels and color harmonies.
Figure 11 on page 36 may serve for comparison purposes.
Example: ‘\def\rangetHsb{60,30;120,60;180,120;210,180;240,240}’ is in
fact xcolor’s default setting.

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 implemen-
tation in xcolor generally allows for all real ‘wavelengths’ λ that have an absolute
value less than 16383.99998 (the biggest number TEX can represent as a dimen-
sion). However, the probability of getting any non-black color outside the range
xcolor v3.02 (2024/09/29) 11

of λ ∈ [363, 814] is exactly zero. Therefore, figure 1 on page 31 illustrates only


the mentioned wavelength interval. Note that it is not possible to convert other
models to wave in a sensible way, since the latter covers only a limited range of
colors.

RGB, HSB, Gray These are derived models, turning the continuous [0, 1] pa-
rameter ranges of rgb, hsb, and gray to finite sets of integers; we therefore use the
term integer models. The constants L, M, N of table 3 are defined via the com-
\rangeRGB mands \def\rangeRGB{⟨L⟩}, \def\rangeHSB{⟨M ⟩}, and \def\rangeGray{⟨N ⟩}.
\rangeHSB Changes of these constants can be done before or after the xcolor package is loaded,
\rangeGray e.g.,

\documentclass{article}
...
\def\rangeRGB{15}
\usepackage[dvips]{xcolor}
...
\GetGinDriver
\usepackage[\GinDriver]{hyperref}
...
\begin{document}
...
\def\rangeRGB{63}
...

2.2.2 Substituting individual color models


\substitutecolormodel {⟨source model ⟩}{⟨target model-list⟩}
Substitute ⟨source model ⟩ by the first actually present model that occurs in ⟨target
model-list⟩. Only color models of type ⟨num model ⟩ are allowed; all changes are
local to the current group, but a prepended \xglobal is obeyed.
Example: assume the actual driver has an incorrect implementation of hsb whereas
rgb looks well. Then \substitutecolormodel{hsb}{rgb} could be a good choice,
since it converts — from that point onwards — all definitions of hsb colors by
xcolor’s algorithms into rgb specifications, without touching other models.

2.2.3 Changing the target color model within a document


\selectcolormodel {⟨num model ⟩}
Sets the target model to ⟨num model ⟩, where the latter is one of the model names
allowed as package option (i.e., natural, rgb, cmy, cmyk, hsb, gray, RGB, HTML,
HSB, Gray), see figure 4 on page 33 for an example. There are two possible hooks,
where the conversion to the target model can take place:
\ifconvertcolorsD • at color definition time3 (i.e., within \definecolor and friends); this is
controlled by the switch \ifconvertcolorsD;
\ifconvertcolorsU • at time of color usage (immediately before a color is displayed, therefore
covering colors that have been defined in other models or that are being
3 This means that all newly defined colors will be first converted to the target model, then

saved.
xcolor v3.02 (2024/09/29) 12

specified directly like \color[rgb]{.1,.2,.3}); this is controlled by the


switch \ifconvertcolorsU.
Both switches are set to ‘true’ by selecting any of the models, except natural,
which sets them to ‘false’. This applies for selection via a package option as well as
via \selectcolormodel. Why don’t we simply convert all colors at time of usage?
If many colors are involved, it can save some processing time when all conversions
are already done during color definitions. Best performance can be achieved by
\usepackage[rgb,...]{xcolor}\convertcolorsUfalse, which is actually the
way how xcolor worked up to version 1.07.

2.3 Arguments and terminology


Before we describe xcolor’s color-related commands in detail, we define several ele-
ments or identifiers that appear repeatedly within arguments of those commands.
A general syntax overview is given in table 4 on the next page.

2.3.1 Additional remarks and restrictions on arguments


⟨empty⟩ Basic strings and numbers These arguments do not need much explanation.
⟨minus⟩ However, as far as numerical values are concerned, it is noteworthy that real
⟨plus⟩ numbers in (La)TEX are — as long as they are to be used in the context of lengths,
⟨int⟩
⟨num⟩ dimensions, or skips — are restricted to a maximum absolute value < 16384.
⟨dec⟩ Certainly, in a chain of numerical calculations, this constraint has also to be obeyed
⟨pct⟩ for every single interim result, which usually implies further range restrictions.
⟨div ⟩ Since xcolor makes extensive use of TEX’s internal dimension registers for most
types of calculations, this should be kept in mind whenever ⟨ext expr ⟩ expressions
are to be used.

⟨name⟩ Color names A ⟨name⟩ denotes the declared name (or the name to be declared)
of a color or a color series; it may be declared explicitly by one of the follow-
ing commands: \definecolor, \providecolor, \colorlet, \definecolorset,
\providecolorset, \definecolorseries, \definecolors, \providecolors. On
the other hand, the reserved color name ‘.’ is declared implicitly and denotes the
current color. Actually, besides letters and digits, certain other characters do also
work for ⟨name⟩ declarations, but the given restriction avoids misunderstandings
and ensures compatibility with future extensions of xcolor.
Examples: ‘red’, ‘MySpecialGreen1980’, ‘.’.

⟨core model ⟩ Color models The differentiation between core models (rgb, cmy, cmyk, hsb,
⟨num model ⟩ gray), integer models (RGB, HTML, HSB, Gray), decimal models (Hsb, tHsb,
⟨model ⟩ wave) and pseudo models (currently ‘named’, ‘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 Hsb and tHsb are special-purpose
versions of hsb, whereas wave and the pseudo model ‘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 ‘ps’: since such colors contain PostScript code, they are absolutely
intransparent for TEX.
xcolor v3.02 (2024/09/29) 13

Table 4: Arguments and terminology

Element Replacement string


⟨empty⟩ → empty string ‘’
⟨minus⟩ → non-empty string consisting of one or more minus signs ‘-’
⟨plus⟩ → non-empty string consisting of one or more plus signs ‘+’
⟨int⟩ → integer number (integer )
⟨num⟩ → non-negative integer number (number )
⟨dec⟩ → real number (decimal)
⟨div ⟩ → non-zero real number (divisor )
⟨pct⟩ → real number from the interval [0, 100] (percentage)
⟨id⟩ → non-empty string consisting of letters and digits (identifier )
⟨ext id⟩ → ⟨id⟩
→ ⟨id⟩1 =⟨id⟩2
⟨id-list⟩ → ⟨ext id⟩1 ,⟨ext id⟩2 ,...,⟨ext id⟩l
⟨name⟩ → ⟨id⟩ (explicit name)
→ ‘.’ (implicit name)
⟨core model⟩ → ‘rgb’, ‘cmy’, ‘cmyk’, ‘hsb’, ‘gray’ (core models)
⟨num model⟩ → ⟨core model⟩
→ ‘RGB’, ‘HTML’, ‘HSB’, ‘Gray’ (integer models)
→ ‘Hsb’, ‘tHsb’, ‘wave’ (decimal models)
⟨model⟩ → ⟨num model⟩ (numerical models)
→ ‘named’ (pseudo model)
⟨model-list⟩ → ⟨model⟩1 /⟨model⟩2 /.../⟨model⟩m (multiple models)
→ ⟨core model⟩:⟨model⟩1 /⟨model⟩2 /.../⟨model⟩m
⟨spec⟩ → comma-separated list of numerical values (explicit specification)
→ space-separated list of numerical values (explicit specification)
→ name of a ‘named’ color (implicit specification)
⟨spec-list⟩ → ⟨spec⟩1 /⟨spec⟩2 /.../⟨spec⟩m (multiple specifications)
⟨type⟩ → ⟨empty⟩
→ ‘named’, ‘ps’
⟨expr ⟩ → ⟨prefix ⟩⟨name⟩⟨mix expr ⟩⟨postfix ⟩ (standard color expression)
⟨prefix ⟩ → ⟨empty⟩
→ ⟨minus⟩ (complement indicator )
⟨mix expr ⟩ → !⟨pct⟩1 !⟨name⟩1 !⟨pct⟩2 !⟨name⟩2 !...!⟨pct⟩n !⟨name⟩n (complete mix expr.)
→ !⟨pct⟩1 !⟨name⟩1 !⟨pct⟩2 !⟨name⟩2 !...!⟨pct⟩n (incomplete mix expr.)
⟨postfix ⟩ → ⟨empty⟩
→ !!⟨plus⟩ (series step)
→ !![⟨num⟩] (series access)
⟨ext expr ⟩ → ⟨core model⟩,⟨div ⟩:⟨expr ⟩1 ,⟨dec⟩1 ;⟨expr ⟩2 ,⟨dec⟩2 ;...;⟨expr ⟩k ,⟨dec⟩k
→ ⟨core model⟩:⟨expr ⟩1 ,⟨dec⟩1 ;⟨expr ⟩2 ,⟨dec⟩2 ;...;⟨expr ⟩k ,⟨dec⟩k
⟨func expr ⟩ → >⟨function⟩,⟨arg⟩1 ,⟨arg⟩2 ,...,⟨arg⟩j (color function expression)
⟨function⟩ → ‘wheel’, ‘twheel’ (color functions)
⟨color ⟩ → ⟨color expr ⟩⟨func expr ⟩1 ⟨func expr ⟩2 ...⟨func expr ⟩i
⟨color expr ⟩ → ⟨name⟩
→ ⟨expr ⟩
→ ⟨ext expr ⟩
Remarks: Each → denotes a possible replacement string for the element in the left column; however, further
context-dependent restrictions may apply. See main text for details. 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 ≤ 8.
xcolor v3.02 (2024/09/29) 14

⟨spec⟩ Color specifications The ⟨spec⟩ argument — which specifies the parameters
of a color — obviously depends on the underlying color model. We differentiate
between explicit and implicit specification, the former referring to numerical pa-
rameters as explained in table 3 on page 10, the latter — ideally — referring to
driver-provided names.
Examples: ‘.1,.2,.3’, ‘.1 .2 .3’, ‘0.56789’, ‘89ABCD’, ‘ForestGreen’.

⟨model-list⟩ Multiple models and specifications These arguments always appear in


⟨spec-list⟩ (explicit or implicit) pairs within the following color definition commands:
\definecolor, \providecolor, \definecolorset, \providecolorset. First,
⟨model-spec⟩ is being reconciled with the current target model (as set by a pack-
age 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 ⟨spec-list⟩, such that we arrive at a proper (⟨model ⟩, ⟨spec⟩)
pair. Therefore, in the actual executed color definition there is no ambiguity any-
more. The extended form ⟨core model ⟩:⟨model ⟩1 /⟨model ⟩2 /.../⟨model ⟩m causes
an immediate conversion of the relevant ⟨spec⟩ to ⟨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’, ‘rgb:cmy/hsb’.

⟨type⟩ The type argument This is used only in the context of color defining com-
mands, see the description of \definecolor and friends.

⟨expr ⟩ Standard color expressions These expressions serve as a tool to easily specify
⟨prefix ⟩ a certain form of cascaded color mixing which is described in detail in section 2.3.2.
⟨mix expr ⟩ The ⟨prefix ⟩ argument controls whether the color following thereafter or its com-
⟨postfix ⟩
plement will be relevant: an odd number of minus signs indicates that the color
resulting from the remaining expression has to be converted into its complemen-
tary color. An incomplete mix expression is just an abbreviation for a complete
mix expression with ⟨name⟩n = white, in order to save some keystrokes in the
case of tints. The ⟨postfix ⟩ string is usually empty, but it offers some additional
functionality in the case of a color series: the non-empty cases require that
• ⟨name⟩ denotes the name of a color series,

• ⟨mix expr ⟩ is a complete mix expression.


Examples: ‘red’, ‘-red’, ‘--red!50!green!12.345’, ‘red!50!green!20!blue’,
‘foo!!+’, ‘foo!![7]’, ‘foo!25!red!!+++’, ‘foo!25!red!70!green!![7]’.

⟨ext expr ⟩ Extended color expressions These expressions provide another method of
color mixing, see section 2.3.3 on page 16 for details. The shorter form

⟨core model ⟩:⟨expr ⟩1 ,⟨dec⟩1 ;⟨expr ⟩2 ,⟨dec⟩2 ;...;⟨expr ⟩k !⟨dec⟩k

is an abbreviation for the special (and probably most used) case

⟨core model ⟩,⟨div ⟩:⟨expr ⟩1 ,⟨dec⟩1 ;⟨expr ⟩2 ,⟨dec⟩2 ;...;⟨expr ⟩k !⟨dec⟩k


xcolor v3.02 (2024/09/29) 15

with the following definition (requiring a non-zero sum of all ⟨dec⟩κ coefficients):

⟨div ⟩ := ⟨dec⟩1 + ⟨dec⟩2 + · · · + ⟨dec⟩k ̸= 0.

Examples: ‘rgb:red,1’, ‘cmyk:red,1;-green!25!blue!60,11.25;blue,-2’.

⟨func expression⟩ Function expressions These expressions extend the functionality of standard
⟨function⟩ or 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 2.3.4 on the following page for details.
Examples: ‘>wheel,30’, ‘>wheel,30,’, ‘>twheel,1,12’, ‘>twheel,-11,12’.

⟨color ⟩ Colors Finally, ⟨color ⟩ is the ‘umbrella’ argument, covering the different con-
⟨color expr ⟩ cepts of specifying colors. This means, whenever there is a ⟨color ⟩ argument, the
full range of names and expressions, as explained above, may be used.

2.3.2 Meaning of standard color expressions


We explain now how an expression

⟨prefix ⟩⟨name⟩!⟨pct⟩1 !⟨name⟩1 !⟨pct⟩2 ! . . . !⟨pct⟩n !⟨name⟩n ⟨postfix ⟩

is being interpreted and processed:


1. First of all, the model and color parameters of ⟨name⟩ are extracted to
define a temporary color ⟨temp⟩. If ⟨postfix ⟩ has the form ‘!![⟨num⟩]’,
then ⟨temp⟩ will be the corresponding (direct-accessed) color ⟨num⟩ from
the series ⟨name⟩.
2. Then a color mix, consisting of ⟨pct⟩1 % of color ⟨temp⟩ and (100 − ⟨pct⟩1 )%
of color ⟨name⟩1 is computed; this is the new temporary color ⟨temp⟩.

3. The previous step is being repeated for all remaining parameter pairs
(⟨pct⟩2 ,⟨name⟩2 ), . . . , (⟨pct⟩n ,⟨name⟩n ).
4. If ⟨prefix ⟩ consists of an odd number of minus signs ‘-’, then ⟨temp⟩ will be
changed into its complementary color.

5. If ⟨postfix ⟩ has the form ‘!!+’, ‘!!++’, ‘!!+++’, etc., a number of step com-
mands (= number of ‘+’ signs) are performed on the underlying color series
⟨name⟩. This has no consequences for the color ⟨temp⟩.
6. Now the color ⟨temp⟩ is being displayed or serves as an input for other
operations, depending on the invoking command.

Note that in a typical step 2 expression ⟨temp⟩!⟨pct⟩ν !⟨name⟩ν , if ⟨pct⟩ν =100


resp. ⟨pct⟩ν =0, the color ⟨temp⟩ resp. ⟨name⟩ν is used without further transfor-
mations. In the true mix case, 0 <⟨pct⟩ν < 100, the two involved colors may have
been defined in different color models, e.g., \definecolor{foo}{rgb}{...} and
\definecolor{bar}{cmyk}{...}. In general, the second color, ⟨name⟩ν , is trans-
formed into the model of the first color, ⟨temp⟩, then the mix is calculated within
xcolor v3.02 (2024/09/29) 16

that model. 4 Thus, ⟨temp⟩!⟨pct⟩ν !⟨name⟩ν and ⟨name⟩ν !⟨100−pct⟩ν !⟨temp⟩,


which should be equivalent theoretically, will not necessarily yield identical vi-
sual results.
Figures 5 to 6 on page 33 show some first applications of colors and expressions.
More examples are given in figure 3 on page 32. Over and above that, a large set
of color examples can be found in [9].

2.3.3 Meaning of extended color expressions


An extended color expression

⟨core model ⟩:⟨expr ⟩1 ,⟨dec⟩1 ;⟨expr ⟩2 ,⟨dec⟩2 ;...;⟨expr ⟩k ,⟨dec⟩k

mimes color mixing as painters do it: specify a list of colors, each with a ⟨dec⟩
factor attached to. For such an ⟨ext expr ⟩, each standard color expression ⟨expr ⟩κ
will be converted to ⟨core model ⟩, then the resulting vector is multiplied by
⟨dec⟩κ /⟨div ⟩, where

⟨div ⟩ := ⟨dec⟩1 + ⟨dec⟩2 + · · · + ⟨dec⟩k .

Afterwards the sum of all of these vectors is calculated.


Example: mixing 4 parts of red, 2 parts of green, and 1 part of
yellow, we get via \color{rgb:red,4;green,2;yellow,1}. Trying the same
with −1 parts of yellow instead, we get . 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

⟨core model ⟩,⟨div ⟩:⟨expr ⟩1 ,⟨dec⟩1 ;⟨expr ⟩2 ,⟨dec⟩2 ;...;⟨expr ⟩k ,⟨dec⟩k

does the same operation with the only difference that the divisor ⟨div ⟩ is being
specified instead of calculated. In the above example, we get a shaded version
via \color{rgb,9:red,4;green,2;yellow,1}. Note that it is not forbidden to
specify a ⟨div ⟩ argument which is smaller than the sum of all ⟨dec⟩κ , such that one
or more of the final color specification parameters could be outside the interval
[0, 1]. However, the mapping of equation (7) takes care of such cases.

2.3.4 Color functions


Color functions take a comma-separated list of arguments, and they serve to trans-
form the given color (i.e., the result of all calculations prior to the function call)
into a new color.

wheel Color wheel calculations Arguments: ⟨angle⟩ or ⟨angle⟩,⟨full circle⟩, the for-
twheel mer being an abbreviataion of ⟨angle⟩,\rangeHsb. These functions allow to cal-
culate related colors by harmonic relations based on color wheels (cf. section 1.4
on page 5). The second argument ⟨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
4 Exception: in order to avoid strange results, this rule is being reversed if ⟨temp⟩ origins from

the gray model; in this case it is converted into the underlying model of ⟨name⟩ν .
xcolor v3.02 (2024/09/29) 17

rotated. To this end, the given color is first converted to Hsb (in case of wheel ),
yielding hue◦ , saturation, and brightness, respectively. Then

⟨angle⟩  hue◦ 
hue◦ := hue◦ + · H, hue := u (4)
⟨full circle⟩ H

where u is the range-reduction function of equation (7) and H = \rangeHsb.


With saturation and brightness left untouched, the final model is hsb. The twheel
function works similarly, but its arguments refer to tHsb instead of Hsb. Examples
are shown in figure 12 on page 37.

2.4 Predefined colors


2.4.1 Colors that are always available
Within xcolor.sty, the following color names are defined: red, green,
blue, cyan, magenta, yellow, black, gray, white,
darkgray, lightgray, brown, lime, olive, orange, pink,
purple, teal, violet.
This base set of colors can be used without restrictions in all kinds of color ex-
pressions, as explained in section 2.3 on page 12.

2.4.2 Additional sets of colors


There are also sets of color names that may be loaded by xcolor via package
options, available in two variants: a ‘normal’ version (e.g., dvipsnames) and a
‘starred’ version (e.g., dvipsnames*). The first variant simply defines all the colors
immediately, whereas the second applies the mechanism of deferred definition. In
the latter case, individual color names have to be activated by \definecolors or
\providecolors commands, as described in section 2.5.4 on page 20, before they
can be applied in a document.

• dvipsnames/dvipsnames* loads a set of 68 cmyk colors as defined in the


dvips driver. However, these colors may be used in all supported drivers.
• svgnames/svgnames* loads a set of 151 rgb color names5 according to the
SVG 1.1 specification [17]6 , enhanced by 4 names taken from the file rgb.txt
which is part of Unix/X11 distributions. Note that HTML4 accepts a subset
of 16 color keywords (using identical specifications), see [16] and section 4
on page 38.
• x11names/x11names* loads a set of 317 rgb color names7 that are basically
variations of a subset of the SVG set mentioned before, according to the file
rgb.txt which is part of Unix/X11 distributions8 . We describe now how to
access all 752 color names of rgb.txt without much effort:
– Load x11names as well as svgnames.
5 Infact, these names represent 141 different colors.
6 Actually, the cited specification lists only lowercase names, and the original definitions are
given in RGB parameters, converted to rgb by the author.
7 These names represent 315 different colors.
8 Again, the original definitions are given in RGB parameters, converted to rgb by the author.
xcolor v3.02 (2024/09/29) 18

– Capitalise initials and skip blanks: DarkSlateGray instead of dark slate


gray.
– X11 names without numbers are identical to the corresponding SVG
colors, except in 5 cases: use Gray0, Grey0, Green0, Maroon0, Purple0
instead of Gray, Grey, Green, Maroon, Purple to obtain the original
X11 colors.
– For N = 0, 1, . . . , 100 use ‘[gray]{N/100}’ or ‘black!100 − N ’ instead
of grayN or greyN .

The color names and corresponding displays are listed in section 4 on page 38.
Section 2.15.1 on page 30 describes how to deal with name clashs while using both
svgnames and dvipsnames in the same document. See also [9] for a systematic
set of color and mix examples.

2.5 Color definition


2.5.1 Ordinary and named colors
In the color package there is a distinction between ‘colors’ (defined by the com-
mand \definecolor) and ‘named colors’ (defined by \DefineNamedColor, which
is allowed only in the preamble). Whenever an ordinary color is being used in
a document, it will be translated into a \special command that contains a —
driver-specific — numerical description of the color which is written to the .dvi
file. On the other hand, named colors offer the opportunity to store numerical
values at a central place whereas during usage, colors may be identified by their
names, thus enabling post-processing if required by the output device.
All drivers delivered with the standard graphics package support the formalism
of defining and invoking ‘named colors’. However, real support for the concept
behind that, i.e. employing names instead of parameters, ranges from ‘none’ to
‘complete’. We demonstrate the current situation for three different drivers:

• dvips has very good support for the ‘named’ concept; the PostScript equiv-
alents to the color names defined by dvipsnames are being loaded – unless
switched off – by dvips automatically. However, additional names have to be
made known to the PostScript interpreter by some kind of header file. Since
version 2.01, xcolor offers an integrated solution for this task: by invoking
the package option prologue, a PostScript header file xcolor.pro is loaded
by dvips. Additionally, under this option every color definition command9
(\definecolor, \colorlet, etc.) will generate some PostScript code that
is written to an auxiliary file with the extension .xcp (shortcut for xcolor
prologue). This file is as well loaded by dvips as a prologue, thus making
all color names available to the PostScript interpreter. Of course, the .xcp
file may be edited before dvips is applied, making it easy to change device-
specific color parameters at a central place. Note that the PostScript code
is designed similar to color.pro: only new names are defined. This allows
to preload other prologue files with color definitions that are not being de-
stroyed by xcolor. On the other hand, it requires the user to take care about
redefining color names.
Example: \colorlet{foo}{red}\colorlet{foo}{blue}\color{foo} will
9 This is not only true for the document preamble, but for the document body as well.
xcolor v3.02 (2024/09/29) 19

switch to blue in the usual xcolor logic, however the .ps file would display
red (unless foo had been defined differently before).
It should be stressed that this mechanism is only employed by the prologue
option. Without that, the predefined ‘named’ colors activated by the
dvipsnames option (without employing any tints, shades, color expressions,
etc.) may be used in this way, all other ‘named’ colors are unknown to
PostScript.
• dvipdfm supports only the standard dvipsnames colors since these are hard-
coded in the dvipdfm program itself; there seems to be no way to load any
user-defined prologue files.
• pdftex does not offer conceptual support, all ‘named’ colors are converted
immediately to their numerical representation. It therefore allows unre-
stricted definition and usage of named colors (although offering no added
value through this).
Typically, a .dvi viewer will have difficulties to display user-defined ‘named’ col-
ors. For example, MiKTEX’s viewer Yap currently displays only ‘named’ colors
from the dvipsnames set. Thus, whenever the prologue option is invoked to-
gether with dvips, all other colors will appear black. However, after employing
dvips, a PostScript viewer should display the correct colors.

2.5.2 Color definition in xcolor


\definecolor [⟨type⟩]{⟨name⟩}{⟨model-list⟩}{⟨spec-list⟩}10
This is one of the commands that may be used to assign a ⟨name⟩ to a specific color.
Afterwards, this color is known to the system (in the current group) and may be
used in color expressions, as explained in section 2.3 on page 12. It replaces both
color’s \DefineNamedColor and \definecolor. Note that an already existing
color ⟨name⟩ will be overwritten. The variable \tracingcolors controls whether
such an overwriting will be logged or not (see section 2.13 on page 29 for details).
The arguments are described in section 2.3 on page 12. Hence, valid expressions
for color definitions are
• \definecolor{red}{rgb}{1,0,0},
• \definecolor{red}{rgb/cmyk}{1,0,0/0,1,1,0},
• \definecolor{red}{hsb:rgb/cmyk}{1,0,0/0,1,1,0},
• \definecolor[named]{Black}{cmyk}{0,0,0,1},
• \definecolor{myblack}{named}{Black},
where the last command is equivalent to \colorlet{myblack}{Black} (see be-
low); the second command defines red in the rgb or cmyk model, depending on
the current setting of the target model, whereas the third will additionally trans-
form the color to hsb prior to saving. Note that there is a special pstricks-related
version as described in section 2.11 on page 28.
\providecolor [⟨type⟩]{⟨name⟩}{⟨model-list⟩}{⟨spec-list⟩}
10 Prior to version 2.00, this command was called \xdefinecolor, the latter name still being

available for compatibility reasons.


xcolor v3.02 (2024/09/29) 20

Similar to \definecolor, but the color ⟨name⟩ is only defined if it does not exist
already.
\colorlet [⟨type⟩]{⟨name⟩}[⟨num model ⟩]{⟨color ⟩}
Copies the actual color which results from ⟨color ⟩ to ⟨name⟩. If ⟨num model ⟩ is
non-empty, ⟨color ⟩ is first transformed to the specified model, before ⟨name⟩ is
being defined. The pseudo model ‘named’ is not allowed here, it may, however,
be specified in the ⟨type⟩ argument. Note that an already existing color ⟨name⟩
will be overwritten.
Example: we said \colorlet{tableheadcolor}{gray!25} in the preamble of
this document. In most of the tables we then formatted the first row by using the
command \rowcolor{tableheadcolor}.

2.5.3 Defining sets of colors


\definecolorset [⟨type⟩]{⟨model-list⟩}{⟨head ⟩}{⟨tail ⟩}{⟨set spec⟩}
This command facilitates the construction of color sets, i.e. (possibly large) sets
of individual colors with common underlying ⟨model-list⟩ and ⟨type⟩. Here, ⟨set
spec⟩ = ⟨name⟩1 ,⟨spec-list⟩1 ;. . . ;⟨name⟩l ,⟨spec-list⟩l (l ≥ 1 name/specification-list
pairs). Individual colors are being constructed by single

\definecolor[⟨type⟩]{⟨head ⟩⟨name⟩λ ⟨tail ⟩}{⟨model-list⟩}{⟨spec-list⟩λ }


commands, λ = 1, . . . , l. For example,
• \definecolorset{rgb}{}{}{red,1,0,0;green,0,1,0;blue,0,0,1}
could be used to define the basic colors red, green, and blue;11

• \definecolorset{rgb}{x}{10}{red,1,0,0;green,0,1,0;blue,0,0,1}
would define the colors xred10, xgreen10, and xblue10.
\providecolorset [⟨type⟩]{⟨model-list⟩}{⟨head ⟩}{⟨tail ⟩}{⟨set spec⟩}
Similar to \definecolorset, but based on \providecolor, thus the individual
colors are defined only if they do not exist already.

2.5.4 Immediate and deferred definitions


Traditionally, the definition of a color as described above leads to the immediate
construction of a command that holds at least the information needed by the driver
to display the desired color. Thus, defining 300 colors, e.g., by loading a huge set
of predefined colors, will result in 300 new commands, although most of them —
except for the purpose of displaying lists of colors — will hardly ever be used within
a document. Along the development of computer memory — increasing in size,
decreasing in price — recent TEX implementations have increased their provisions
for internal memory stacks that are available for strings, control sequences, etc.
However, as memory continues to be finite, it may still be useful (or occasionally
necessary) to have a method at hand that allows to reduce memory requirements a
bit. This is the point where deferred color definition comes into play. Its principle
is simple: for every definition of this type (e.g., via \preparecolor), all necessary
11 Actually,
xcolor uses a more complicated variant to provide the basic colors for different
underlying models (see the source code for the full command):
\definecolorset{rgb/hsb/cmyk/gray}{}{}{red,1,0,0/0,1,1/0,1,1,0/.3;green,...}.
xcolor v3.02 (2024/09/29) 21

information is saved on a specific global definition stack, where it can be taken from
later (e.g., via \definecolors) in order to construct the actual color command.
Note that the following commands are only to be used in the document preamble,
since the definition stack of colors for deferred definitions is deleted at the begin
of the document body — in order to save memory.
\preparecolor [⟨type⟩]{⟨name⟩}{⟨model-list⟩}{⟨spec-list⟩}
Similar to \definecolor, but the color ⟨name⟩ is not yet being defined: the ar-
guments ⟨model-list⟩ and ⟨spec-list⟩ are evaluated immediately, then all necessary
parameters (i.e. ⟨type⟩, ⟨name⟩, ⟨model ⟩, ⟨spec⟩) are put onto the definition stack
for later usage.
\preparecolorset [⟨type⟩]{⟨model-list⟩}{⟨head ⟩}{⟨tail ⟩}{⟨set spec⟩}
\ifdefinecolors Similar to \definecolorset, but depending on the \ifdefinecolors switch: if
set to ‘true’, to each element of the set the command \definecolor (i.e. im-
mediate definition) is applied; if set to ‘false’, \preparecolor (i.e. deferred def-
inition) is applied. For example, the package option svgnames performs some-
thing like \definecolorstrue\preparecolorset, whereas svgnames* acts like
\definecolorsfalse\preparecolorset. Both options set \definecolorstrue
at the end, in order to have a proper starting point for other color sets.
\DefineNamedColor {⟨type⟩}{⟨name⟩}{⟨model-list⟩}{⟨spec-list⟩} is provided mainly for compatibil-
ity reasons, especially to support the predefined colors in dvipsnam.def. It is
the same as ⟨cmd ⟩[⟨type⟩]{⟨name⟩}{⟨model ⟩}{⟨spec⟩}, where ⟨cmd ⟩ is either
\definecolor or \preparecolor, depending on the state of \ifdefinecolors.
Note that color’s restriction to allow \DefineNamedColor only in the document
preamble has been abolished in xcolor.
\definecolors {⟨id-list⟩}
Recall that ⟨id-list⟩ has the form ⟨ext id ⟩1 ,...,⟨ext id ⟩l where each ⟨ext id ⟩λ
is either an identifier ⟨id ⟩λ or an assignment ⟨id ⟩λ′ =⟨id ⟩λ . We consider the first
case to be an abbreviation for ⟨id ⟩λ =⟨id ⟩λ and describe the general case: the
definition stack is searched for the name ⟨id ⟩λ and its corresponding color param-
eters; if there is no match, nothing happens; if the name ⟨id ⟩λ is on the stack
and its color parameters are ⟨type⟩λ , ⟨model ⟩λ , and ⟨spec⟩λ , then the command
\definecolor[⟨type⟩λ ]{⟨id ⟩λ′ }{⟨model ⟩λ }{⟨spec⟩λ } is executed. Thus, the user
may control by which names the prepared colors are to be used in the document.
Note that the entry ⟨id ⟩λ is not removed from the stack, such that it can be used
several times (even within the same \definecolors command).
\providecolors {⟨id-list⟩}
Similar to \definecolors, but based on \providecolor, thus the individual col-
ors are defined only if they do not exist already.

2.5.5 Global color definitions


\ifglobalcolors By default, definitions via \definecolor, \providecolor, . . . are available only
within the current group. By setting \globalcolorstrue, all such definitions are
\xglobal being made globally available — until the current group ends.12 Another method
to specify that an individual color definition is to be made global is to prefix it by
\xglobal, e.g., \xglobal\definecolor{foo}....
12 The switch may also be set in the preamble in order to control the whole document.
xcolor v3.02 (2024/09/29) 22

2.6 Color application


2.6.1 Standard color commands
Here is the list of user-level color commands, as known from the color package,
but with an extended syntax for the colors, allowing for expressions etc.:
\color {⟨color ⟩}
[⟨model-list⟩]{⟨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.
\textcolor {⟨color ⟩}{⟨text⟩}
[⟨model-list⟩]{⟨spec-list⟩}{⟨text⟩}
are just alternative syntax for \color, in which the groups are added implicitly.
Thus ⟨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.
\pagecolor {⟨color ⟩}
[⟨model-list⟩]{⟨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 ⟨color ⟩ resp. ⟨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.
Note that color-specific commands from other packages may give unexpected re-
sults if directly confronted with color expressions (e.g., soul’s \sethlcolor and
friends). However, one can turn the expression into a name via \colorlet and
try to use that name instead.
\nopagecolor Removes any currently specified page color returning to the default transparent
background. It is not yet supported by all driver options and so generates a
warning if there is no definition in the driver file.

2.6.2 Colored boxes


\colorbox {⟨color ⟩}{⟨text⟩}
[⟨model-list⟩]{⟨spec-list⟩}{⟨text⟩}
Takes the same argument forms as \textcolor, but the color specifies the back-
ground color of the box.
\fcolorbox {⟨frame color ⟩}{⟨background color ⟩}{⟨text⟩}
[⟨model-list⟩]{⟨frame spec-list⟩}{⟨background spec-list⟩}{⟨text⟩}
[⟨fr. model-list⟩]{⟨fr. spec-list⟩}[⟨backgr. model-list⟩]{⟨backgr. spec-list⟩}{⟨text⟩}
{⟨frame color ⟩}[⟨background model-list⟩]{⟨background spec-list⟩}{⟨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 expressions as ar-
guments, \fcolorbox now offers more flexibility for its arguments than the color
version:
• test \fcolorbox{gray}{yellow}{test},

• test \fcolorbox[cmyk]{0,0,0,0.5}{0,0,1,0}{test},
xcolor v3.02 (2024/09/29) 23

• test \fcolorbox[gray]{0.5}[wave]{580}{test},

• test \fcolorbox{gray}[wave]{580}{test}.
Additionally, \fcolorbox uses a new approach to frame drawing, which is an
extension of Donald Arseneau’s suggestion in bug report latex/3655 [2]. 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 after the box
contents has been constructed. This ensures that the frame is always on top of
the box. Donald Arseneau improved speed as well as memory requirements of this
approach. Furthermore, a new macro is introduced:
\boxframe {⟨width⟩}{⟨height⟩}{⟨depth⟩}
Draws a frame with a linewidth of \fboxrule. Returns a \hbox with outer di-
mensions ⟨width⟩, ⟨height⟩, ⟨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 Donald Arseneau.
The new frame approach is used for \fcolorbox as well as LATEX’s \fbox and
\framebox commands, unless the kernelfbox option is specified, which returns
to LATEX’s original definitions of \f(rame)box.
Option xcdraw uses PostScript commands to draw frames and color boxes in case
of the dvips driver and PDF code to draw frames in case of the pdftex and
dvipdfm drivers. This is still experimental code that may confuse .dvi viewers.
The opposite option noxcdraw forces usage of the generic (driver-independent)
code.

2.6.3 Colors in math


While it is possible to color parts of a formula using \color commands the ap-
proach is fairly cumbersome. Therefore the command \mathcolor has been added
to the color and xcolor package, which has the same syntax as \textcolor. The
full documentation and examples of its use is in mathcolor.pdf in the LATEX
documentation.

2.6.4 Using the current color


Within a color expression, ‘.’ serves as a placeholder for the current color. See
figure 7 on page 33 for an example.
It is also possible to save the current color for later use, e.g., via the command
\colorlet{foo}{.}.
Note that in some cases the current color is of rather limited use, e.g., the con-
struction of an \fcolorbox implies that at the time when the ⟨background color ⟩
is evaluated, the current color equals the ⟨frame color ⟩; in this case ‘.’ does not
refer to the current color outside the box.

2.6.5 Color testing


testcolors (env.) [⟨num models⟩]
This is a simple tabular environment in order to test (display) colors in different
models, showing both the visual result and the model-specific parameters. The
optional ⟨num models⟩ argument is a comma-separated list of numerical color
xcolor v3.02 (2024/09/29) 24

models (as usual without spaces) which form the table columns; the default list is
rgb,cmyk,hsb,HTML.
\testcolor {⟨color ⟩}
[⟨model-list⟩]{⟨spec-list⟩}
Each \testcolor command generates a table row, containing a display sam-
ple 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.
For applications see figure 2 on page 31 and figures 11, 12.

2.7 Color blending


The purpose of color blending is to add some mixing color (expression) to all
subsequent explicit color commands. Thus, it is possible to perform such a mix
(or blend) operation for many colors without touching the individual commands.
\blendcolors {⟨mix expr ⟩}
\blendcolors* {⟨mix expr ⟩}
Initialises all necessary parameters for color blending. The actual (completed)
color blend expression is stored in \colorblend. In the starred version, the argu-
ment will be appended to a previously defined blend expression. An empty ⟨mix
expr ⟩ argument will switch blending off.
Example: after \blendcolors{!50!yellow}, the colors are trans-
formed into , an additional \blendcolors*{!50} yields .
\xglobal In order to achieve global scope, \blendcolors may be prefixed by \xglobal.
Remark: color blending is applied only to explicit color commands, i.e. \color,
\fcolorbox and the like. In the previous example the frames are not being blended
because their color is set by an driver-internal command (switching back to the
‘current color’). Thus, to influence these implicit colors as well, we have to set
the current color after the blending: \blendcolors{!50!yellow}\color{black}
results in , an additional \blendcolors*{!50}\color{black} yields
.

2.8 Color masks and separation


The purpose of color separation is to represent all colors that appear in the doc-
ument as a combination of a finite subset of base colors and their tints. Most
prominent is cmyk separation, where the base colors are cyan, magenta, yellow,
and black, as required by the printers. This can be done by choosing the pack-
age option cmyk, such that all colors will be converted in this model, and post-
processing the output file. We describe now another — and more general —
solution: color masking. How does it work? Color masking is based on a speci-
fied color model ⟨m-model ⟩ and a parameter vector ⟨m-spec⟩. Whenever a color
is to be displayed in the document, it will first be converted to ⟨m-model ⟩, af-
terwards each component of the resulting color vector will be multiplied by the
corresponding component of ⟨m-spec⟩. For example, let’s assume that ⟨m-model ⟩
equals cmyk, and ⟨m-spec⟩ equals (µc , µm , µy , µk ). Then an arbitrary color foo will
be transformed according to

foo 7→ (c, m, y, k) 7→ (µc · c, µm · m, µy · y, µk · k) (5)


xcolor v3.02 (2024/09/29) 25

Obviously, color separation is a special case of masking by the vectors (1, 0, 0, 0),
(0, 1, 0, 0), etc. An interesting application is to shade or tint all colors by masking
them with (x, x, x) in the rgb or cmy model, see the last two rows in figure 9 on
page 35.
\maskcolors [⟨num model ⟩]{⟨color ⟩}
Initialises all necessary parameters for color masking: if ⟨num model ⟩ is not spec-
ified (or empty), ⟨m-model ⟩ will be set to the natural model of ⟨color ⟩, other-
wise to ⟨num model ⟩; the color specification of ⟨color ⟩ is extracted to define
\ifmaskcolors ⟨m-spec⟩. Additionally, \maskcolorstrue is performed. Color masking can be
switched off temporarily by \maskcolorsfalse, or — in a more radical way —
\xglobal by \maskcolors{}, which in addition clears the initialisation parameters. In gen-
eral, the scope of \maskcolors is the current group (unless it is prefixed by the
\xglobal command), but it may be used in the document preamble as well. The
final remark of the color blending section applies here similarly.
Now it is easy to separate a complete document without touching the source code:
latex \def\xcolorcmd{\maskcolors[cmyk]{cyan}}\input{a} will do the cyan
part of the job for a.tex.
\colormask Caution: xcolor has no idea about colors in files that are included via the command
\includegraphics, e.g., images of type .eps, .pdf, .jpg, or .png. Such files
have to be separated separately. Nevertheless, xcolor offers some basic support by
storing the mask color in \colormask, which can be used to decide which file is
to be included:
\def\temp{cyan}\ifx\colormask\temp \includegraphics{foo_c}\else
\def\temp{magenta}\ifx\colormask\temp \includegraphics{foo_m}\else
...
\fi\fi

2.9 Color series


Automatic coloring may be useful in graphics or chart applications, where a —
potentially large and unspecified — number of colors are needed, and the user does
not want or is not able to specify each individual color. Therefore, we introduce
the term color series, which consists of a base color and a scheme, how the next
color is being constructed from the current color.
The practical application consists of three parts: definition of a color series (usu-
ally once in the document), initialisation of the series (potentially several times),
and application — with or without stepping — of the current color of the series
(potentially many times).

2.9.1 Definition of a color series


\definecolorseries {⟨name⟩}{⟨core model ⟩}{⟨method ⟩}[⟨b-model ⟩]{⟨b-spec⟩}[⟨s-model ⟩]{⟨s-spec⟩}
Defines a color series called ⟨name⟩, whose calculations are performed within the
color model ⟨core model ⟩, where ⟨method ⟩ selects the algorithm (one of step, grad,
last, see below). The method details are determined by the remaining arguments:
• [⟨b-model ⟩]{⟨b-spec⟩} specifies the base (= first) color in the algorithm,
either directly, e.g., [rgb]{1,0.5,0.5}, or as a ⟨color ⟩, e.g., {-yellow!50},
if the optional argument is missing.
xcolor v3.02 (2024/09/29) 26

• [⟨s-model ⟩]{⟨s-spec⟩} specifies how the step vector is calculated in the al-
gorithm, according to the chosen ⟨method ⟩:
– step, grad: the optional argument is meaningless, and ⟨s-spec⟩ is a
parameter vector whose dimension is determined by ⟨core model ⟩, e.g.,
{0.1,-0.2,0.3} in case of rgb, cmy, or hsb.
– last: the last color is specified either directly, e.g., [rgb]{1,0.5,0.5},
or as a ⟨color ⟩, e.g., {-yellow!50}, if the optional argument is missing.
This is the general scheme:

color1 := base, colorn+1 := U colorn + step (6)

for n = 1, 2, . . . , where U maps arbitrary real m-vectors into the unit m-cube:
(
1 if x = 1
U (x1 , . . . , xm ) = (u(x1 ), . . . , u(xm )), u(x) = (7)
x − [x] if x ̸= 1

Thus, every step of the algorithm yields a valid color with parameters from the
interval [0, 1].
Now, the different methods use different schemes to calculate the step vector:
• step, grad: the last argument, {⟨s-spec⟩}, defines the directional vector grad.
• last: {⟨s-spec⟩} resp. [⟨s-model ⟩]{⟨s-spec⟩} defines the color parameter vec-
tor last.
Then, during \resetcolorseries, the actual step vector is calculated:

grad

 if ⟨method ⟩ = step
1
step := ⟨div ⟩ · grad if ⟨method ⟩ = grad (8)

 1 · (last − base) if ⟨method ⟩ = last

⟨div ⟩

Please note that it is also possible to use the current color placeholder ‘.’ within the
definition of color series. Thus, \definecolorseries{foo}{rgb}{last}{.}{-.}
will set up a series that starts with the current color and ends with its complement.
Of course, similar to TEX’s \let primitive, the current definition of the current
color at the time of execution is used, there is no relation to current colors in any
later stage of the document.

2.9.2 Initialisation of a color series


\resetcolorseries [⟨div ⟩]{⟨name⟩}
This command has to be applied at least once, in order to make use of the color
series ⟨name⟩. It resets the current color of the series to the base color and calcu-
lates the actual step vector according to the chosen ⟨div ⟩, a non-zero real number,
\colorseriescycle for the methods grad and last, see equation (8). If the optional argument is
empty, the value stored in the macro \colorseriescycle is applied. Its default
value is 16, which can be changed by \def\colorseriescycle{⟨div ⟩}, applied be-
fore the xcolor package is loaded (similar to \rangeRGB and friends). The optional
argument is ignored in case of the step method.
xcolor v3.02 (2024/09/29) 27

2.9.3 Application of a color series


There are two ways to display the current color of a color series: any of the
color expressions in section 2.3 on page 12 used within a \color, \textcolor,
. . . command will display this color according to the usual syntax of such ex-
pressions. However, in the cases when ⟨postfix ⟩ equals ‘!!+’, \color{⟨name⟩!!+}
etc., will not only display the color, but it will also perform a step operation.
Thus, the current color of the series will be changed in that case. An expression
\color{⟨name⟩!![⟨num⟩]} enables direct access to an element of a series, where
⟨num⟩ = 0, 1, 2, . . . , starting with 0 for the base color. See figure 8 on page 34 for
a demonstration of different methods.

2.9.4 Differences between colors and color series


Although they behave similar if applied within color expressions, the objects
defined by \definecolor and \definecolorseries are fundamentally different
with respect to their scope/availability: like color’s original \definecolor com-
mand, \definecolor generates local colors, whereas \definecolorseries gener-
ates global objects (otherwise it would not be possible to use the stepping mech-
anism within tables or graphics conveniently). E.g., if we assume that bar is an
undefined color, then after saying
\begingroup
\definecolorseries{foo}{rgb}{last}{red}{blue}
\resetcolorseries[10]{foo}
\definecolor{bar}{rgb}{.6,.5,.4}
\endgroup

commands like \color{foo} or \color{foo!!+} may be used without restrictions,


whereas \color{bar} will give an error message. However, it is possible to say
\colorlet{bar}{foo} or \colorlet{bar}{foo!!+} in order to save the current
color of a series locally — with or without stepping.

2.10 Border colors for hyperlinks


Change 2022: The options described in this subsection have been removed from
the code as no longer relevant. hyperref can handle color names in the border color
keys.
This affects the package options hyperref, and the Keys xcitebordercolor , xfilebor-
dercolor , xlinkbordercolor , xmenubordercolor , xpagebordercolor , xrunbordercolor ,
xurlbordercolor and xpdfborder .
The hyperref package offers all kinds of support for hyperlinks, pdfmarks etc. There
are two standard ways to make hyperlinks visible (see the package documentation
[14] for additional information on how to set up these features):
• print hyperlinks in a different color than normal text, using the keys cite-
color , filecolor , linkcolor , menucolor , pagecolor , runcolor , urlcolor with color
expressions, e.g., \hypersetup{urlcolor=-green!50};
• display a colored border around hyperlinks, using the keys citebordercolor ,
filebordercolor , linkbordercolor , menubordercolor , pagebordercolor , runbor-
dercolor , urlbordercolor with explicit numerical rgb parameter specification,
e.g., \hypersetup{urlbordercolor={1 0.5 0.25}}.
xcolor v3.02 (2024/09/29) 28

Obviously, the second method is somewhat inconvenient since it does not allow
for color names or even color expressions. Therefore, xcolor provides — via the
package option hyperref — a set of extended keys xcitebordercolor , xfilebor-
dercolor , xlinkbordercolor , xmenubordercolor , xpagebordercolor , xrunbordercolor ,
xurlbordercolor which are being used in conjunction with color expressions, e.g.,
\hypersetup{xurlbordercolor=-green!50}.
Another new key, xpdfborder , provides a way to deal with a dvips-related prob-
lem: for most of the drivers, a setting like pdfborder={0 0 1} will determine
the width of the border that is drawn around hyperlinks in points. However, in
the dvips case, the numerical parameters are interpreted in relation to the chosen
output resolution for processing the .dvi file into a .ps file. Unfortunately, at
the time when the .dvi is constructed, nobody knows if and at which resolution
a transformation into .ps will take place afterwards. Consequently, any default
value for pdfborder may be useful or not. Within hyperref, the default for dvips
is pdfborder={0 0 12}, which works fine for a resolution of 600 or 1200 dpi, but
which produces an invisible border for a resolution of 8000 dpi, as determined by
the command-line switch -Ppdf. On the other hand, setting pdfborder={0 0 80}
works fine for dvips at 8000 dpi, but makes a document unportable, since other
drivers (or even dvips in a low resolution) will draw very thick boxes in that case.
This is were the xpdfborder key comes in handy: it rescales its arguments for the
dvips case by a factor 80 (ready for 8000 dpi) and leaves everything unchanged
for other drivers. Thus one can say xpdfborder={0 0 1} in a driver-independent
way.

2.11 Additional color specification in the pstricks world


For pstricks users, there are different ways of invoking colors within command
option keys:
• \psset{linecolor=green!50}
• \psset{linecolor=[rgb]{0.5,1,0.5}}

• \psframebox[linecolor={[rgb]{0.5,1,0.5}}]{foo}
Note the additional curly braces in the last case; without them, the optional
argument of \psframebox would be terminated too early.
\definecolor [ps]{⟨name⟩}{⟨core model-list⟩}{⟨code⟩}
Stores PostScript ⟨code⟩ — that should not contain slash ‘/’ characters — within
a color. Example: after \definecolor[ps]{foo}{rgb}{bar}, the pstricks com-
mand \psline[linecolor=foo]... inserts ‘bar setrgbcolor’ where the line-
color information is required — at least in case of the dvips driver. See also
xcolor2.tex for an illustrative application.

2.12 Color in tables


The commands in this subsection were in previous versions provided by the xcolor
package as an extension of the colortbl commands. They have now been merged
into the colortbl package properly. The package can be loaded either with the table
option or independently with \usepackage. The description of the commands is
kept only for historical reasons. If in doubt consult the documentation of colortbl.
xcolor v3.02 (2024/09/29) 29

\rowcolors [⟨commands⟩]{⟨row ⟩}{⟨odd-row color ⟩}{⟨even-row color ⟩}


\rowcolors* [⟨commands⟩]{⟨row ⟩}{⟨odd-row color ⟩}{⟨even-row color ⟩}
One of these commands has to be executed before a table starts. ⟨row ⟩ tells the
number of the first row which should be colored according to the ⟨odd-row color ⟩
and ⟨even-row color ⟩ scheme. Each of the color arguments may also be left empty
(= no color). In the starred version, ⟨commands⟩ are ignored in rows with inactive
rowcolors status (see below), whereas in the non-starred version, ⟨commands⟩ are
applied to every row of the table. Such optional commands may be \hline or
\noalign{⟨stuff ⟩}.
\showrowcolors The rowcolors status is activated (i.e., use coloring scheme) by default and/or
\hiderowcolors \showrowcolors, it is inactivated (i.e., ignore coloring scheme) by the command
\rownum \hiderowcolors. The counter \rownum may be used within such a table to access
the current row number. An example is given in figure 10 on page 35.
Note that table coloring may be combined with color series. This method was
used to construct the examples in figure 8 on page 34.

2.13 Color information


\extractcolorspec {⟨color ⟩}{⟨cmd ⟩}
Extracts the color specification of ⟨color ⟩ and puts it into ⟨cmd ⟩; equivalent to
\def\cmd{{⟨model ⟩}{⟨spec⟩}}.
\extractcolorspecs {⟨color ⟩}{⟨model-cmd ⟩}{⟨color-cmd ⟩}
Extracts the color specification of ⟨color ⟩ and puts it into ⟨model-cmd ⟩ and
⟨color-cmd ⟩, respectively.
\tracingcolors =⟨int⟩
Controls the amount of information that is written into the log file:
• ⟨int⟩ ≤ 0: no specific color logging.

• ⟨int⟩ ≥ 1: ignored color definitions due to \providecolor are logged.


• ⟨int⟩ ≥ 2: multiple (i.e. overwritten) color definitions are logged.
• ⟨int⟩ ≥ 3: every command that defines a color will be logged.

• ⟨int⟩ ≥ 4: every command that sets a color will be logged.


Like TEX’s \tracing... commands, this command may be used globally (in the
document preamble) or locally/block-wise. The package sets \tracingcolors=0
as default. Remark: since registers are limited and valuable, no counter is wasted
for this issue.
Note that whenever a color is used that has been defined via color’s \definecolor
command rather than xcolor’s new \definecolor and friends, a warning message
‘Incompatible color definition’ will be issued.13

2.14 Color conversion


\convertcolorspec {⟨model ⟩}{⟨spec⟩}{⟨target model ⟩}{⟨cmd ⟩}
Converts a color, given by the ⟨spec⟩ in model ⟨model ⟩, into ⟨target model ⟩ and
stores the new color specification in \cmd. ⟨target model ⟩ must be of type ⟨num
13 This should not happen since usually there is no reason to load color in parallel to xcolor.
xcolor v3.02 (2024/09/29) 30

model ⟩, whereas ⟨model ⟩ may also be ‘named’, in which case ⟨spec⟩ is simply the
name of the color.
Example: \convertcolorspec{cmyk}{0.81,1,0,0.07}{HTML}\tmp acts like \def
\tmp{1F00ED}.

2.15 Problems and solutions


2.15.1 Name clashs between dvipsnames and svgnames
Due to the fixed option processing order (which does not depend on the order how
the options were specified in the \usepackage command), the svgnames colors
will always overrule dvipsnames colors with identical names. This can lead to
undesired results if both options are used together. For instance, Fuchsia yields
under the regime of dvipsnames and with respect to svgnames. However,
there is a simple trick — based on deferred color definition — that allows us to
use colors from both sets in the desired way:
\usepackage[dvipsnames*,svgnames]{xcolor}
\definecolors{Fuchsia}

Now all colors from the SVG set are available (except Fuchsia) plus Fuchsia from
the other set.

2.15.2 Change color of included .eps file


In general, xcolor cannot change colors of an image that is being included via
the \includegraphics command from the graphics or graphicx package. There is,
however, a limited opportunity to influence the current color of included PostScript
files. Consider the following file foo.eps which draws a framed gray box:
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 60 12
0 0 60 12 rectfill
0.75 setgray
2 2 56 8 rectfill

Now run the following code through LATEX and dvips:


\documentclass{minimal}
\usepackage[fixinclude]{xcolor}
\usepackage{graphics}
\begin{document}
\includegraphics{foo} \textcolor{red}{\includegraphics{foo}}
\end{document}

The resulting .ps file will display two gray boxes: the first with a black frame, the
second with a red frame. If we had omitted the fixinclude option, the second
box would also display a black frame. This is because dvips usually resets the
current color to black immediately before including an .eps file.
xcolor v3.02 (2024/09/29) 31

3 Examples

Figure 1: Color spectrum

360 380 400 420 440 460 480 500 520 540 560 580 600 620 640 660 680 700 720 740 760 780 800

\newcount\WL \unitlength.75pt
\begin{picture}(460,60)(355,-10)
\sffamily \tiny \linethickness{1.25\unitlength} \WL=360
\multiput(360,0)(1,0){456}%
{{\color[wave]{\the\WL}\line(0,1){50}}\global\advance\WL1}
\linethickness{0.25\unitlength}\WL=360
\multiput(360,0)(20,0){23}%
{\picture(0,0)
\line(0,-1){5} \multiput(5,0)(5,0){3}{\line(0,-1){2.5}}
\put(0,-10){\makebox(0,0){\the\WL}}\global\advance\WL20
\endpicture}
\end{picture}

Figure 2: Color testing

color rgb cmyk hsb HTML gray


olive 0.5 0.5 0 00 1 0.5 0.16667 1 0.5 808000 0.39
red!50!green 0.5 0.5 0 00 0.5 0.5 0.16667 1 0.5 808000 0.445
-cyan!50!magenta 0.5 0.5 0 00 0.5 0.5 0.16667 1 0.5 808000 0.445
[cmyk]0,0,1,0.5 0.5 0.5 0 00 1 0.5 0.16667 1 0.5 808000 0.39
[cmyk]0,0,.5,.5 0.5 0.5 0 00 0.5 0.5 0.16667 1 0.5 808000 0.445
[rgb:cmyk]0,0,.5,.5 0.5 0.5 0 00 0.5 0.5 0.16667 1 0.5 808000 0.445

\sffamily
\begin{testcolors}[rgb,cmyk,hsb,HTML,gray]
\testcolor{olive}
\testcolor{red!50!green}
\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}
xcolor v3.02 (2024/09/29) 32

Figure 3: Progressing from one to another color

100 95 90 85 80 75 70 65 60 55 50 45 40 35 30 25 20 15 10 5 0
MyGreen! !white
MyGreen-rgb! !white
MyGreen-cmy! !white
MyGreen-hsb! !white
MyGreen-gray! !white
MyGreen! !gray
MyGreen-rgb! !gray
MyGreen-cmy! !gray
MyGreen-hsb! !gray
MyGreen-gray! !gray
MyGreen! !black
MyGreen-rgb! !black
MyGreen-cmy! !black
MyGreen-hsb! !black
MyGreen-gray! !black
MyGreen! !red
MyGreen-rgb! !red
MyGreen-cmy! !red
MyGreen-hsb! !red
MyGreen-gray! !red
MyGreen! !blue
MyGreen-rgb! !blue
MyGreen-cmy! !blue
MyGreen-hsb! !blue
MyGreen-gray! !blue
MyGreen! !yellow
MyGreen-rgb! !yellow
MyGreen-cmy! !yellow
MyGreen-hsb! !yellow
MyGreen-gray! !yellow

Color Definition/representation ( pdftex driver)


MyGreen {0.92 0 0.87 0.09 k 0.92 0 0.87 0.09 K}{cmyk}{0.92,0,0.87,0.09}
MyGreen-rgb {0 0.91 0.04001 rg 0 0.91 0.04001 RG}{rgb}{0,0.91,0.04001}
MyGreen-cmy {1 0.09 0.95999 0 k 1 0.09 0.95999 0 K}{cmy}{1,0.09,0.95999}
MyGreen-hsb {0 0.91 0.03995 rg 0 0.91 0.03995 RG}{hsb}{0.34065,1,0.91}
MyGreen-gray {0.5383 g 0.5383 G}{gray}{0.5383}
xcolor v3.02 (2024/09/29) 33

Figure 4: Target color model

\selectcolormodel
...{natural}
...{rgb}
...{cmy}
...{cmyk}
...{hsb}
...{gray}

Figure 5: Standard color expressions

red -red
red!75 -red!75
red!75!green -red!75!green
red!75!green!50 -red!75!green!50
red!75!green!50!blue -red!75!green!50!blue
red!75!green!50!blue!25 -red!75!green!50!blue!25
red!75!green!50!blue!25!gray -red!75!green!50!blue!25!gray

Figure 6: Standard color expressions


\fboxrule6pt
\fcolorbox
{red!70!green}% outer frame
{yellow!30!blue}% outer background
{\fcolorbox TestTestTest
{-yellow!30!blue}% inner frame
{-red!70!green}% inner background
{Test\textcolor{red!72.75}{Test}\color{-green}Test}}

Figure 7: Current color


\def\test{current, \textcolor{.!50}{50\%},
\textcolor{-.}{complement},
\textcolor{yellow!50!.}{mix}}
current, 50%, complement, mix
\textcolor{blue}{\test}\\
and current, 50%, complement, mix
and \textcolor{red}{\test}\\
TestTestTestTestTest
\def\Test{\color{.!80}Test}
and TestTestTestTestTest
\textcolor{blue}{\Test\Test\Test\Test\Test}\\
and \textcolor{red}{\Test\Test\Test\Test\Test}
xcolor v3.02 (2024/09/29) 34

Figure 8: Color series

S1 S2 G1 G2 L1 L2 L3 L4 L5
1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2
3 3 3 3 3 3 3 3 3
4 4 4 4 4 4 4 4 4
5 5 5 5 5 5 5 5 5
6 6 6 6 6 6 6 6 6
7 7 7 7 7 7 7 7 7
8 8 8 8 8 8 8 8 8
9 9 9 9 9 9 9 9 9
10 10 10 10 10 10 10 10 10
11 11 11 11 11 11 11 11 11
12 12 12 12 12 12 12 12 12
13 13 13 13 13 13 13 13 13
14 14 14 14 14 14 14 14 14
15 15 15 15 15 15 15 15 15
16 16 16 16 16 16 16 16 16

Individual definitions
S1 \definecolorseries{test}{rgb}{step}[rgb]{.95,.85,.55}{.17,.47,.37}
S2 \definecolorseries{test}{hsb}{step}[hsb]{.575,1,1}{.11,-.05,0}
G1 \definecolorseries{test}{rgb}{grad}[rgb]{.95,.85,.55}{3,11,17}
G2 \definecolorseries{test}{hsb}{grad}[hsb]{.575,1,1}{.987,-.234,0}
L1 \definecolorseries{test}{rgb}{last}[rgb]{.95,.85,.55}[rgb]{.05,.15,.55}
L2 \definecolorseries{test}{hsb}{last}[hsb]{.575,1,1}[hsb]{-.425,.15,1}
L3 \definecolorseries{test}{rgb}{last}{yellow!50}{blue}
L4 \definecolorseries{test}{hsb}{last}{yellow!50}{blue}
L5 \definecolorseries{test}{cmy}{last}{yellow!50}{blue}
Common definitions
\resetcolorseries[12]{test}
\rowcolors[\hline]{1}{test!!+}{test!!+}
\begin{tabular}{c}
\number\rownum\\ \number\rownum\\ \number\rownum\\ \number\rownum\\
\number\rownum\\ \number\rownum\\ \number\rownum\\ \number\rownum\\
\number\rownum\\ \number\rownum\\ \number\rownum\\ \number\rownum\\
\number\rownum\\ \number\rownum\\ \number\rownum\\ \number\rownum\\
\end{tabular}
xcolor v3.02 (2024/09/29) 35

Figure 9: Color masking

\maskcolors
...{}
...[cmyk]{cyan}
...[cmyk]{magenta}
...[cmyk]{yellow}
...[cmyk]{black}
...[cmyk]{red}
...[cmyk]{green}
...[cmyk]{blue}
...[rgb]{red}
...[rgb]{green}
...[rgb]{blue}
...[hsb]{red}
...[hsb]{green}
...[hsb]{blue}
...[rgb]{gray}
...[cmy]{gray}

Figure 10: Alternating row colors in tables: \rowcolors vs. \rowcolors*


\rowcolors[\hline]{3}{green!25}{yellow!50} \arrayrulecolor{red!75!gray}
\begin{tabular}{ll}
test & row \number\rownum\\
test & row \number\rownum\\ test row 1 test row 1
test & row \number\rownum\\ test row 2 test row 2
test & row \number\rownum\\
\arrayrulecolor{black}
test row 3 test row 3
test & row \number\rownum\\ test row 4 test row 4
test & row \number\rownum\\ test row 5 test row 5
\rowcolor{blue!25} test row 6 test row 6
test & row \number\rownum\\
test row 7 test row 7
test & row \number\rownum\\
\hiderowcolors test row 8 test row 8
test & row \number\rownum\\ test row 9 test row 9
test & row \number\rownum\\ test row 10 test row 10
\showrowcolors test row 11 test row 11
test & row \number\rownum\\
test row 12 test row 12
test & row \number\rownum\\
\multicolumn{1}% test row 13 test row 13
{>{\columncolor{red!12}}l}{test} & row \number\rownum\\
\end{tabular}
xcolor v3.02 (2024/09/29) 36

Figure 11: Hsb and tHsb: hue◦ in 15◦ steps

color rgb cmyk hsb Hsb tHsb


[Hsb]0,1,1 100 0110 011 011 011
[Hsb]15,1,1 1 0.25002 0 0 0.74998 1 0 0.04167 1 1 15.00128 1 1 30.00256 1 1
[Hsb]30,1,1 1 0.49998 0 0 0.50002 1 0 0.08333 1 1 29.99872 1 1 59.99744 1 1
[Hsb]45,1,1 1 0.75 0 0 0.25 1 0 0.125 1 1 45 1 1 90 1 1
[Hsb]60,1,1 0.99998 1 0 0.00002 0 1 0 0.16667 1 1 60.00128 1 1 120.00128 1 1
[Hsb]75,1,1 0.75002 1 0 0.24998 0 1 0 0.20833 1 1 74.99872 1 1 134.99872 1 1
[Hsb]90,1,1 0.5 1 0 0.5 0 1 0 0.25 1 1 90 1 1 150 1 1
[Hsb]105,1,1 0.24998 1 0 0.75002 0 1 0 0.29167 1 1 105.00128 1 1 165.00128 1 1
[Hsb]120,1,1 0.00002 1 0 0.99998 0 1 0 0.33333 1 1 119.99872 1 1 179.99872 1 1
[Hsb]135,1,1 0 1 0.25 1 0 0.75 0 0.375 1 1 135 1 1 187.5 1 1
[Hsb]150,1,1 0 1 0.50002 1 0 0.49998 0 0.41667 1 1 150.00128 1 1 195.00064 1 1
[Hsb]165,1,1 0 1 0.74998 1 0 0.25002 0 0.45833 1 1 164.99872 1 1 202.49936 1 1
[Hsb]180,1,1 011 1000 0.5 1 1 180 1 1 210 1 1
[Hsb]195,1,1 0 0.74998 1 1 0.25002 0 0 0.54167 1 1 195.00128 1 1 217.50064 1 1
[Hsb]210,1,1 0 0.50002 1 1 0.49998 0 0 0.58333 1 1 209.99872 1 1 224.99936 1 1
[Hsb]225,1,1 0 0.25 1 1 0.75 0 0 0.625 1 1 225 1 1 232.5 1 1
[Hsb]240,1,1 0.00002 0 1 0.99998 1 0 0 0.66667 1 1 240.00128 1 1 240.00128 1 1
[Hsb]255,1,1 0.24998 0 1 0.75002 1 0 0 0.70833 1 1 254.99872 1 1 254.99872 1 1
[Hsb]270,1,1 0.5 0 1 0.5 1 0 0 0.75 1 1 270 1 1 270 1 1
[Hsb]285,1,1 0.75002 0 1 0.24998 1 0 0 0.79167 1 1 285.00128 1 1 285.00128 1 1
[Hsb]300,1,1 0.99998 0 1 0.00002 1 0 0 0.83333 1 1 299.99872 1 1 299.99872 1 1
[Hsb]315,1,1 1 0 0.75 0 1 0.25 0 0.875 1 1 315 1 1 315 1 1
[Hsb]330,1,1 1 0 0.49998 0 1 0.50002 0 0.91667 1 1 330.00128 1 1 330.00128 1 1
[Hsb]345,1,1 1 0 0.25002 0 1 0.74998 0 0.95833 1 1 344.99872 1 1 344.99872 1 1
[Hsb]360,1,1 100 0110 111 360 1 1 360 1 1

[tHsb]0,1,1 100 0110 011 011 011


[tHsb]15,1,1 1 0.12498 0 0 0.87502 1 0 0.02083 1 1 7.49872 1 1 14.99744 1 1
[tHsb]30,1,1 1 0.25002 0 0 0.74998 1 0 0.04167 1 1 15.00128 1 1 30.00256 1 1
[tHsb]45,1,1 1 0.375 0 0 0.625 1 0 0.0625 1 1 22.5 1 1 45 1 1
[tHsb]60,1,1 1 0.49998 0 0 0.50002 1 0 0.08333 1 1 29.99872 1 1 59.99744 1 1
[tHsb]75,1,1 1 0.62502 0 0 0.37498 1 0 0.10417 1 1 37.50128 1 1 75.00256 1 1
[tHsb]90,1,1 1 0.75 0 0 0.25 1 0 0.125 1 1 45 1 1 90 1 1
[tHsb]105,1,1 1 0.87498 0 0 0.12502 1 0 0.14583 1 1 52.49872 1 1 104.99744 1 1
[tHsb]120,1,1 0.99998 1 0 0.00002 0 1 0 0.16667 1 1 60.00128 1 1 120.00128 1 1
[tHsb]135,1,1 0.75002 1 0 0.24998 0 1 0 0.20833 1 1 74.99872 1 1 134.99872 1 1
[tHsb]150,1,1 0.5 1 0 0.5 0 1 0 0.25 1 1 90 1 1 150 1 1
[tHsb]165,1,1 0.24998 1 0 0.75002 0 1 0 0.29167 1 1 105.00128 1 1 165.00128 1 1
[tHsb]180,1,1 0.00002 1 0 0.99998 0 1 0 0.33333 1 1 119.99872 1 1 179.99872 1 1
[tHsb]195,1,1 0 1 0.50002 1 0 0.49998 0 0.41667 1 1 150.00128 1 1 195.00064 1 1
[tHsb]210,1,1 011 1000 0.5 1 1 180 1 1 210 1 1
[tHsb]225,1,1 0 0.50002 1 1 0.49998 0 0 0.58333 1 1 209.99872 1 1 224.99936 1 1
[tHsb]240,1,1 0.00002 0 1 0.99998 1 0 0 0.66667 1 1 240.00128 1 1 240.00128 1 1
[tHsb]255,1,1 0.24998 0 1 0.75002 1 0 0 0.70833 1 1 254.99872 1 1 254.99872 1 1
[tHsb]270,1,1 0.5 0 1 0.5 1 0 0 0.75 1 1 270 1 1 270 1 1
[tHsb]285,1,1 0.75002 0 1 0.24998 1 0 0 0.79167 1 1 285.00128 1 1 285.00128 1 1
[tHsb]300,1,1 0.99998 0 1 0.00002 1 0 0 0.83333 1 1 299.99872 1 1 299.99872 1 1
[tHsb]315,1,1 1 0 0.75 0 1 0.25 0 0.875 1 1 315 1 1 315 1 1
[tHsb]330,1,1 1 0 0.49998 0 1 0.50002 0 0.91667 1 1 330.00128 1 1 330.00128 1 1
[tHsb]345,1,1 1 0 0.25002 0 1 0.74998 0 0.95833 1 1 344.99872 1 1 344.99872 1 1
[tHsb]360,1,1 100 0110 111 360 1 1 360 1 1
xcolor v3.02 (2024/09/29) 37

Figure 12: Color harmony

color rgb cmyk Hsb tHsb


complementary colors (two-color harmony):
yellow>wheel,1,2 0.00002 0 1 0.99998 1 0 0 240.00128 1 1 240.00128 1 1
yellow 110 0010 60.00128 1 1 120.00128 1 1
yellow>twheel,1,2 1 0 0.99995 0 1 0.00005 0 300.00256 1 1 300.00256 1 1

color triad (three-color harmony):


yellow>wheel,2,3 1 0 0.99995 0 1 0.00005 0 300.00256 1 1 300.00256 1 1
yellow>wheel,1,3 011 1000 180 1 1 210 1 1
yellow 110 0010 60.00128 1 1 120.00128 1 1
yellow>twheel,1,3 0.00002 0 1 0.99998 1 0 0 240.00128 1 1 240.00128 1 1
yellow>twheel,2,3 1 0.00012 0 0 0.99988 1 0 0.00714 1 1 0.01428 1 1

color tetrad (four-color harmony):


yellow>wheel,3,4 1 0 0.49998 0 1 0.50002 0 330.00128 1 1 330.00128 1 1
yellow>wheel,2,4 0.00002 0 1 0.99998 1 0 0 240.00128 1 1 240.00128 1 1
yellow>wheel,1,4 0 1 0.50002 1 0 0.49998 0 150.00128 1 1 195.00064 1 1
yellow 110 0010 60.00128 1 1 120.00128 1 1
yellow>twheel,1,4 0 0.99988 1 1 0.00012 0 0 180.00714 1 1 210.00357 1 1
yellow>twheel,2,4 1 0 0.99995 0 1 0.00005 0 300.00256 1 1 300.00256 1 1
yellow>twheel,3,4 1 0.25002 0 0 0.74998 1 0 15.00128 1 1 30.00256 1 1

split complementary colors:


yellow>wheel,7,12 0.5 0 1 0.5 1 0 0 270 1 1 270 1 1
yellow>wheel,5,12 0 0.49995 1 1 0.50005 0 0 210.00256 1 1 225.00128 1 1
yellow 110 0010 60.00128 1 1 120.00128 1 1
yellow>twheel,5,12 0.50018 0 1 0.49982 1 0 0 270.01099 1 1 270.01099 1 1
yellow>twheel,7,12 1 0 0.49998 0 1 0.50002 0 330.00128 1 1 330.00128 1 1

analogous (adjacent) colors:


yellow>wheel,11,12 1 0.50005 0 0 0.49995 1 0 30.00256 1 1 60.00513 1 1
yellow>wheel,10,12 100 0110 360 1 1 360 1 1
yellow>wheel,2,12 0 1 0.00005 1 0 0.99995 0 120.00256 1 1 180.00128 1 1
yellow>wheel,1,12 0.5 1 0 0.5 0 1 0 90 1 1 150 1 1
yellow 110 0010 60.00128 1 1 120.00128 1 1
yellow>twheel,1,12 0.5 1 0 0.5 0 1 0 90 1 1 150 1 1
yellow>twheel,2,12 0 1 0.00021 1 0 0.99979 0 120.013 1 1 180.0065 1 1
yellow>twheel,10,12 1 0.50005 0 0 0.49995 1 0 30.00256 1 1 60.00513 1 1
yellow>twheel,11,12 1 0.75012 0 0 0.24988 1 0 45.00714 1 1 90.01428 1 1
xcolor v3.02 (2024/09/29) 38

4 Colors by Name

4.1 Base colors (always available)

black darkgray lime pink violet


blue gray magenta purple white
brown green olive red yellow
cyan lightgray orange teal

4.2 Colors via dvipsnames option

Apricot Cyan Mahogany ProcessBlue SpringGreen


Aquamarine Dandelion Maroon Purple Tan
Bittersweet DarkOrchid Melon RawSienna TealBlue
Black Emerald MidnightBlue Red Thistle
Blue ForestGreen Mulberry RedOrange Turquoise
BlueGreen Fuchsia NavyBlue RedViolet Violet
BlueViolet Goldenrod OliveGreen Rhodamine VioletRed
BrickRed Gray Orange RoyalBlue White
Brown Green OrangeRed RoyalPurple WildStrawberry
BurntOrange GreenYellow Orchid RubineRed Yellow
CadetBlue JungleGreen Peach Salmon YellowGreen
CarnationPink Lavender Periwinkle SeaGreen YellowOrange
Cerulean LimeGreen PineGreen Sepia
CornflowerBlue Magenta Plum SkyBlue

4.3 Colors via svgnames option

AliceBlue DarkKhaki Green LightSlateGrey


AntiqueWhite DarkMagenta GreenYellow LightSteelBlue
Aqua DarkOliveGreen Grey LightYellow
Aquamarine DarkOrange Honeydew Lime
Azure DarkOrchid HotPink LimeGreen
Beige DarkRed IndianRed Linen
Bisque DarkSalmon Indigo Magenta
Black DarkSeaGreen Ivory Maroon
BlanchedAlmond DarkSlateBlue Khaki MediumAquamarine
Blue DarkSlateGray Lavender MediumBlue
BlueViolet DarkSlateGrey LavenderBlush MediumOrchid
Brown DarkTurquoise LawnGreen MediumPurple
BurlyWood DarkViolet LemonChiffon MediumSeaGreen
CadetBlue DeepPink LightBlue MediumSlateBlue
Chartreuse DeepSkyBlue LightCoral MediumSpringGreen
Chocolate DimGray LightCyan MediumTurquoise
Coral DimGrey LightGoldenrod MediumVioletRed
CornflowerBlue DodgerBlue LightGoldenrodYellow MidnightBlue
Cornsilk FireBrick LightGray MintCream
Crimson FloralWhite LightGreen MistyRose
Cyan ForestGreen LightGrey Moccasin
DarkBlue Fuchsia LightPink NavajoWhite
DarkCyan Gainsboro LightSalmon Navy
DarkGoldenrod GhostWhite LightSeaGreen NavyBlue
DarkGray Gold LightSkyBlue OldLace
DarkGreen Goldenrod LightSlateBlue Olive
DarkGrey Gray LightSlateGray OliveDrab
xcolor v3.02 (2024/09/29) 39

Orange Plum Sienna Thistle


OrangeRed PowderBlue Silver Tomato
Orchid Purple SkyBlue Turquoise
PaleGoldenrod Red SlateBlue Violet
PaleGreen RosyBrown SlateGray VioletRed
PaleTurquoise RoyalBlue SlateGrey Wheat
PaleVioletRed SaddleBrown Snow White
PapayaWhip Salmon SpringGreen WhiteSmoke
PeachPuff SandyBrown SteelBlue Yellow
Peru SeaGreen Tan YellowGreen
Pink Seashell Teal

Duplicate colors: Aqua = Cyan, Fuchsia = Magenta; Navy = NavyBlue; Gray = Grey, DarkGray
= DarkGrey, LightGray = LightGrey, SlateGray = SlateGrey, DarkSlateGray = DarkSlateGrey,
LightSlateGray = LightSlateGrey, DimGray = DimGrey.
HTML4 color keyword subset: Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy,
Olive, Purple, Red, Silver, Teal, White, Yellow.
Colors taken from Unix/X11: LightGoldenrod, LightSlateBlue, NavyBlue, VioletRed.

4.4 Colors via x11names option

AntiqueWhite1 Chocolate3 DeepPink1 IndianRed3


AntiqueWhite2 Chocolate4 DeepPink2 IndianRed4
AntiqueWhite3 Coral1 DeepPink3 Ivory1
AntiqueWhite4 Coral2 DeepPink4 Ivory2
Aquamarine1 Coral3 DeepSkyBlue1 Ivory3
Aquamarine2 Coral4 DeepSkyBlue2 Ivory4
Aquamarine3 Cornsilk1 DeepSkyBlue3 Khaki1
Aquamarine4 Cornsilk2 DeepSkyBlue4 Khaki2
Azure1 Cornsilk3 DodgerBlue1 Khaki3
Azure2 Cornsilk4 DodgerBlue2 Khaki4
Azure3 Cyan1 DodgerBlue3 LavenderBlush1
Azure4 Cyan2 DodgerBlue4 LavenderBlush2
Bisque1 Cyan3 Firebrick1 LavenderBlush3
Bisque2 Cyan4 Firebrick2 LavenderBlush4
Bisque3 DarkGoldenrod1 Firebrick3 LemonChiffon1
Bisque4 DarkGoldenrod2 Firebrick4 LemonChiffon2
Blue1 DarkGoldenrod3 Gold1 LemonChiffon3
Blue2 DarkGoldenrod4 Gold2 LemonChiffon4
Blue3 DarkOliveGreen1 Gold3 LightBlue1
Blue4 DarkOliveGreen2 Gold4 LightBlue2
Brown1 DarkOliveGreen3 Goldenrod1 LightBlue3
Brown2 DarkOliveGreen4 Goldenrod2 LightBlue4
Brown3 DarkOrange1 Goldenrod3 LightCyan1
Brown4 DarkOrange2 Goldenrod4 LightCyan2
Burlywood1 DarkOrange3 Green1 LightCyan3
Burlywood2 DarkOrange4 Green2 LightCyan4
Burlywood3 DarkOrchid1 Green3 LightGoldenrod1
Burlywood4 DarkOrchid2 Green4 LightGoldenrod2
CadetBlue1 DarkOrchid3 Honeydew1 LightGoldenrod3
CadetBlue2 DarkOrchid4 Honeydew2 LightGoldenrod4
CadetBlue3 DarkSeaGreen1 Honeydew3 LightPink1
CadetBlue4 DarkSeaGreen2 Honeydew4 LightPink2
Chartreuse1 DarkSeaGreen3 HotPink1 LightPink3
Chartreuse2 DarkSeaGreen4 HotPink2 LightPink4
Chartreuse3 DarkSlateGray1 HotPink3 LightSalmon1
Chartreuse4 DarkSlateGray2 HotPink4 LightSalmon2
Chocolate1 DarkSlateGray3 IndianRed1 LightSalmon3
Chocolate2 DarkSlateGray4 IndianRed2 LightSalmon4
xcolor v3.02 (2024/09/29) 40

LightSkyBlue1 Orange3 RosyBrown1 SpringGreen3


LightSkyBlue2 Orange4 RosyBrown2 SpringGreen4
LightSkyBlue3 OrangeRed1 RosyBrown3 SteelBlue1
LightSkyBlue4 OrangeRed2 RosyBrown4 SteelBlue2
LightSteelBlue1 OrangeRed3 RoyalBlue1 SteelBlue3
LightSteelBlue2 OrangeRed4 RoyalBlue2 SteelBlue4
LightSteelBlue3 Orchid1 RoyalBlue3 Tan1
LightSteelBlue4 Orchid2 RoyalBlue4 Tan2
LightYellow1 Orchid3 Salmon1 Tan3
LightYellow2 Orchid4 Salmon2 Tan4
LightYellow3 PaleGreen1 Salmon3 Thistle1
LightYellow4 PaleGreen2 Salmon4 Thistle2
Magenta1 PaleGreen3 SeaGreen1 Thistle3
Magenta2 PaleGreen4 SeaGreen2 Thistle4
Magenta3 PaleTurquoise1 SeaGreen3 Tomato1
Magenta4 PaleTurquoise2 SeaGreen4 Tomato2
Maroon1 PaleTurquoise3 Seashell1 Tomato3
Maroon2 PaleTurquoise4 Seashell2 Tomato4
Maroon3 PaleVioletRed1 Seashell3 Turquoise1
Maroon4 PaleVioletRed2 Seashell4 Turquoise2
MediumOrchid1 PaleVioletRed3 Sienna1 Turquoise3
MediumOrchid2 PaleVioletRed4 Sienna2 Turquoise4
MediumOrchid3 PeachPuff1 Sienna3 VioletRed1
MediumOrchid4 PeachPuff2 Sienna4 VioletRed2
MediumPurple1 PeachPuff3 SkyBlue1 VioletRed3
MediumPurple2 PeachPuff4 SkyBlue2 VioletRed4
MediumPurple3 Pink1 SkyBlue3 Wheat1
MediumPurple4 Pink2 SkyBlue4 Wheat2
MistyRose1 Pink3 SlateBlue1 Wheat3
MistyRose2 Pink4 SlateBlue2 Wheat4
MistyRose3 Plum1 SlateBlue3 Yellow1
MistyRose4 Plum2 SlateBlue4 Yellow2
NavajoWhite1 Plum3 SlateGray1 Yellow3
NavajoWhite2 Plum4 SlateGray2 Yellow4
NavajoWhite3 Purple1 SlateGray3 Gray0
NavajoWhite4 Purple2 SlateGray4 Green0
OliveDrab1 Purple3 Snow1 Grey0
OliveDrab2 Purple4 Snow2 Maroon0
OliveDrab3 Red1 Snow3 Purple0
OliveDrab4 Red2 Snow4
Orange1 Red3 SpringGreen1
Orange2 Red4 SpringGreen2

Duplicate colors: Gray0 = Grey0, Green0 = Green1.


xcolor v3.02 (2024/09/29) 41

5 Technical Supplement
5.1 Color models supported by drivers
Since some of the drivers only pretend to support the hsb model, we included some
code to bypass this behaviour. The models actually added by xcolor are shown in
the log file. Table 5 lists mainly the drivers that are part of current MiKTEX [11]
distributions and their color model support. Probably, other distributions behave
similarly.

Table 5: Drivers and color models

Driver Version rgb cmy cmyk hsb gray RGB HTML HSB Gray
dvipdf 2015/12/30 v3.0k d n d n d i n n n
dvips 2015/12/30 v3.0k d n d d d i n n n
dvipsone 2015/12/30 v3.0k d n d d d i n n n
pctex32 2015/12/30 v3.0k d n d d d i n n n
pctexps 2015/12/30 v3.0k d n d d d i n n n
pdftex 2011/05/27 v0.06d d n d n d i n n n
luatex 2016/01/23 v0.01b d n d n d i n n n
dvipdfm 1999/9/6 vx.x d n d n d i n n n
dvipdfmx 2016/04/06 v4.08 d n d ? d i n n n
textures 1997/5/28 v0.3 d n d ? i n n n n
vtex 1999/01/14 v6.3 d n d n i i n n n
xetex 2016/04/06 v4.08 d n d d d i n n n
tcidvi 2015/12/30 v3.0k i n i n i d n n n
truetex 2015/12/30 v3.0k i n i n i d n n n
dviwin 2015/12/30 v3.0k n n n n n n n n n
emtex 2015/12/30 v3.0k n n n n n n n n n
pctexhp 2015/12/30 v3.0k n n n n n n n n n
pctexwin 2015/12/30 v3.0k n n n n n n n n n
dviwindo = dvipsone; oztex = dvips; xdvi = dvips + monochrome
Driver’s color model support: d = direct, i = indirect, n = none

5.2 How xcolor handles driver-specific color models


Although there is a variety of drivers that implement different approaches to color
visualisation, they all have some features in common, as defined by the origi-
nal color package. One of these features is that any color model ‘foo’ requires a
\color@foo{⟨cmd ⟩}{⟨spec⟩} command in order to translate the ‘foo’-dependent
color ⟨spec⟩ into some driver-specific code that is stored in ⟨cmd ⟩. Therefore,
xcolor in general detects driver-support for the ‘foo’ model via the existence of
\color@foo.
By this mechanism, xcolor can also change the behaviour of certain models with-
out touching the driver file itself. A good example is the \substitutecolormodel
command which is used during the package initialisation process to provide sup-
port for models that are not covered by the actual driver (like hsb for pdftex) or
that have incorrect implementations (like hsb for dvipdfm).
xcolor v3.02 (2024/09/29) 42

5.3 Behind the scenes: internal color representation


Every definition of a color in order to access it by its name requires an internal
representation of the color, i.e. a macro that contains some bits of information
required by the driver to display the color properly.
color’s \definecolor{foo}{...}{...} generates a command \\color@foo14
which contains the color definition in a driver-dependent way; therefore it is pos-
sible but non-trivial to access the color model and parameters afterwards (see the
colorinfo package [12] for a solution).
color’s \DefineNamedColor{named}{foo}{...}{...} generates \col@foo15 which
again contains some driver-dependent information. In this case, an additional
\\color@foo will only be defined if the package option usecolors is active.
xcolor’s \definecolor{foo}{...}{...} generates16 a command \\color@foo as
well, which combines the features of the former commands and contains both
the driver-dependent and driver-independent information, thus making it possible
to access the relevant parameters in a standardised way. Although it has now
a different syntax, \\color@foo expands to the same expression as the original
command. On the other hand, \col@foo commands are no longer needed and
therefore not generated in the ‘named’ case: xcolor works with a single color data
structure (as described).
Table 6 on the following page shows some examples for the two most prominent
drivers. See also figure 3 on page 32 which displays the definitions with respect to
the driver that was used to process this document.

5.4 A remark on accuracy


Since the macros presented here require some computation, special efforts were
made to ensure a maximum of accuracy for conversion and mixing formulas — all
within TEX’s limited numerical capabilities.17 We decided to develop and include
a small set of commands to improve the quality of division and multiplication
results, instead of loading one of the packages that provide multi-digit arithmetic
and a lot more, like realcalc or fp. The marginal contribution of the latter packages
seems not to justify their usage for our purposes. Thus, we stay within a sort of
fixed-point arithmetic framework, providing at most 5 decimal digits via TEX’s
dimension registers.

14 The double backslash is intentional.


15 The single backslash is intentional.
16 This was introduced in version 1.10; prior to that, a command \\xcolor@foo with a different

syntax was generated.


17 For example, applying the ‘transformation’ \dimen0=0.⟨int⟩pt \the\dimen0 to all 5-digit

numbers ⟨int⟩ of the range 00000. . . 99999, exactly 34464 of these 100000 numbers don’t survive
unchanged. We are not talking about gobbled final zeros here . . .
xcolor v3.02 (2024/09/29) 43

Table 6: Driver-dependent internal color representation

dvips driver
\\color@Plum=macro: (\definecolor{Plum}{rgb}{.5,0,1}) color
->rgb .5 0 1.
\\color@Plum=macro: (\definecolor{Plum}{rgb}{.5,0,1}) xcolor
->\xcolor@ {}{rgb 0.5 0 1}{rgb}{0.5,0,1}.
\col@Plum=macro: (\DefineNamedColor{Plum}{rgb}{.5,0,1}) color
->\@nil .
\\color@Plum=macro: (with option usenames)
-> Plum.
\\color@Plum=macro: (\definecolor[named]{Plum}{rgb}{.5,0,1}) xcolor
->\xcolor@ {named}{ Plum}{rgb}{0.5,0,1}.
pdftex driver
\\color@Plum=macro: (\definecolor{Plum}{rgb}{.5,0,1}) color
->.5 0 1 rg .5 0 1 RG.
\\color@Plum=macro: (\definecolor{Plum}{rgb}{.5,0,1}) xcolor
->\xcolor@ {}{0.5 0 1 rg 0.5 0 1 RG}{rgb}{0.5,0,1}.
\col@Plum=macro: (\DefineNamedColor{Plum}{rgb}{.5,0,1}) color
->.5 0 1 rg .5 0 1 RG.
\\color@Plum=macro: (with option usenames)
->.5 0 1 rg .5 0 1 RG.
\\color@Plum=macro: (\definecolor[named]{Plum}{rgb}{.5,0,1}) xcolor
->\xcolor@ {}{0.5 0 1 rg 0.5 0 1 RG}{rgb}{0.5,0,1}.
xcolor v3.02 (2024/09/29) 44

6 The Formulas
6.1 Color mixing
In general, we use linear interpolation for color mixing:

mix(C, C ′ , p) = p · C + (1 − p) · C ′ (9)

Note that there is a special situation in the hsb case: if saturation = 0 then
the color equals a gray color of level brightness, independently of the hue value.
Therefore, to achieve smooth transitions of an arbitrary color to a specific gray
(like white or black), we actually use the formulas

tint hsb (C, p) = p · C + (1 − p) · hue, 0, 1 (10)

shade hsb (C, p) = p · C + (1 − p) · hue, 0, 0 (11)
1

tone hsb (C, p) = p · C + (1 − p) · hue, 0, 2 (12)

where C = (hue, saturation, brightness).


From equation (9) and the way how color expressions are being interpreted, as
described in section 2.3 on page 12, it is an easy proof by induction to verify that
a color expression

C0 !P1 !C1 !P2 ! . . .!Pn !Cn (13)

with n ∈ {0, 1, 2, . . . }, colors C0 , C1 , . . . , Cn , and percentages P1 , . . . , Pn ∈ [0, 100]


will result in a parameter vector
n n
!
X Y
C= pµ (1 − pν ) · Cν
ν=0 µ=ν+1

= pn · · · p1 · C0
+ pn · · · p2 (1 − p1 ) · C1 (14)
+ pn · · · p3 (1 − p2 ) · C2
+ ...
+ pn (1 − pn−1 ) · Cn−1
+ (1 − pn ) · Cn

where p0 := 0 and pν := Pν /100 for ν = 1, . . . , n. We note also a split formula:

C0 !P1 !C1 ! . . .!Pn+k !Cn+k = pn+k · · · pn+1 · C0 !P1 !C1 ! . . .!Pn !Cn
− pn+k · · · pn+1 · Cn (15)
+ Cn !Pn+1 !Cn+1 ! . . .!Pn+k !Cn+k

6.2 Conversion between integer and real models


We fix a positive integer n and define the sets In := {0, 1, . . . , n} and R := [0, 1].
The complement of ν ∈ In is n − ν, the complement of x ∈ R is 1 − x.
xcolor v3.02 (2024/09/29) 45

Table 7: Color constants

model/constant white black gray


rgb (1, 1, 1) (0, 0, 0) ( 12 , 11
2,
2)
cmy (0, 0, 0) (1, 1, 1) ( 12 , 11
2,
2)
cmyk (0, 0, 0, 0) (0, 0, 0, 1) (0, 0, 0, 21 )
hsb (h, 0, 1) (h, 0, 0) (h, 0, 21 )

Hsb (h , 0, 1) (h◦ , 0, 0) (h◦ , 0, 21 )
tHsb (h◦ , 0, 1) (h◦ , 0, 0) (h◦ , 0, 12 )
1
gray 1 0 2
RGB (L, L, L) (0, 0, 0) (⌊ L+1 L+1
2 ⌋, ⌊ 2 ⌋, ⌊ 2 ⌋)
L+1

HTML FFFFFF 000000 808080


HSB (H, 0, M ) (H, 0, 0) (H, 0, ⌊ M2+1 ⌋)
Gray N 0 ⌊ N2+1 ⌋

Table 8: Color conversion pairs

from/to rgb cmy cmyk hsb Hsb tHsb gray RGB HTML HSB Gray
rgb id ∗ (cmy) ∗ (hsb) (hsb) ∗ ∗ ∗ (hsb) (gray)
cmy ∗ id ∗ (rgb) (rgb) (rgb) ∗ (rgb) (rgb) (rgb) (gray)
cmyk (cmy) ∗ id (cmy) (cmy) (cmy) ∗ (cmy) (cmy) (cmy) (gray)
hsb ∗ (rgb) (rgb) id ∗ (Hsb) (rgb) (rgb) (rgb) ∗ (rgb)
Hsb (hsb) (hsb) (hsb) ∗ id ∗ (hsb) (hsb) (hsb) (hsb) (hsb)
tHsb (Hsb) (Hsb) (Hsb) (Hsb) ∗ id (Hsb) (Hsb) (Hsb) (Hsb) (Hsb)
gray ∗ ∗ ∗ ∗ ∗ ∗ id ∗ ∗ ∗ ∗
RGB ∗ (rgb) (rgb) (rgb) (rgb) (rgb) (rgb) id (rgb) (rgb) (rgb)
HTML ∗ (rgb) (rgb) (rgb) (rgb) (rgb) (rgb) (rgb) id (rgb) (rgb)
HSB (hsb) (hsb) (hsb) ∗ (hsb) (hsb) (hsb) (hsb) (hsb) id (hsb)
Gray (gray) (gray) (gray) (gray) (gray) (gray) ∗ (gray) (gray) (gray) id
wave (hsb) (hsb) (hsb) ∗ (hsb) (hsb) (hsb) (hsb) (hsb) (hsb) (hsb)
id = identity function; ∗ = specific conversion function;
(model) = conversion via specified model
xcolor v3.02 (2024/09/29) 46

6.2.1 Real to integer conversion


The straightforward mapping for this case is
1 
Γn : R → In , x 7→ round(n · x, 0) = 2 +n·x (16)

where round(r, d) rounds the real number r to d ≥ 0 decimal digits. This mapping
nearly always preserves complements, as shown in the next lemma.
Lemma 1 (Preservation of complements). For x ∈ R,

/ R◦n := n1 ν − 12 ν = 1, 2, . . . , n .
 
Γn (x) + Γn (1 − x) = n ⇐⇒ x ∈ (17)

Proof. Let ν := Γn (x), then from − 21 ≤ η := n · x − ν < 1


2we conclude
(
n−ν if η ̸= − 21
Γn (1 − x) = round(n(1 − x), 0) = round(n − ν − η, 0) =
n−ν+1 if η = − 21

Now, η = − 12 ⇐⇒ x = 1 1
⇐⇒ x ∈ In′ .

n ν− 2

Remark: the set R◦n is obviously identical to the set of points where Γn is not
continuous.

6.2.2 Integer to real conversion


The straightforward way in this case is the function
ν
∆∗n : In → R, ν 7→ . (18)
n
This is, however, only one out of a variety of solutions: every function ∆n : In → R
that obeys the condition

ν ∈ In ⇒ Γn ∆n (ν) = ν (19)

which is equivalent to
1 1
ν ∈ In ⇒ ν + > n · ∆n (ν) ≥ ν − (20)
2 2
does at least guarantee that all integers ν may be reconstructed from ∆n (ν) via
multiplication by n and rounding to the nearest integer. Preservation of comple-
ments means now

ν ∈ In ⇒ ∆n (ν) + ∆n (n − ν) = 1 (21)

which is obviously the case for ∆n = ∆∗n . If we consider, more generally, a


transformation
ν+α
∆n (ν) = (22)
n+β
with β ̸= −n, then the magic inequality (20) is equivalent to
1 αn − βν 1
> ≥− (23)
2 n+β 2
xcolor v3.02 (2024/09/29) 47

which is obeyed by the function


(
ν n+1
if ν ≤
∆′n : In → R, ν 7→ n+1 2
(24)
ν+1 n+1
n+1 if ν > 2

that has the nice feature ∆′n n+1 1



2 = 2 for odd n.
Lemma 2 (Preservation of complements). For odd n and each ν ∈ In ,

∆′n (ν) + ∆′n (n − ν) = 1 ⇐⇒ ν ∈


/ In◦ := n−1 n+1

2 , 2 . (25)

Proof. The assertion is a consequence of the following arguments:


• ν< n−1
2 ⇐⇒ n − ν > n+1
2 and n−1
2 + n+1
2 = n;
• ν< n−1
2 ⇒ ∆′n (ν) + ∆′n (n − ν) = ν
n+1 + n−ν+1
n+1 = 1;

• ν= n−1
2 ⇒ ∆′n (ν) + ∆′n (n − ν) = n−1
2(n+1) + 1
2 = n
n+1 ̸= 1.

For the time being, we choose ∆n := ∆∗n as default transformation function.


Another variant — which is probably too slow for large-scale on-the-fly calculations
— may be used for constructing sets of predefined colors. The basic idea is to
minimize the number of decimal digits in the representation while keeping some
invariance with respect to the original resolution:

∆′′n : In → R, ν 7→ round nν , dn ( nν )

(26)

where

dn : [0, 1] → IN, x 7→ min d ∈ IN Γn round(∆∗n (Γn (x)), d) = Γn (x)


 
(27)

In the most common case n = 255 it turns out that we end up with at
most 3 decimal digits; preservation of complements is only violated for ν ∈
{25, 26, 76, 77, 127, 128, 178, 179, 229, 230} where the corresponding set of decimal
numbers is {0.098, 0.1, 0.298, 0.3, 0.498, 0.5, 0.698, 0.7, 0.898, 0.9}.

6.3 Color conversion and complements


We collect here the specific conversion formulas between the supported color mod-
els. Table 8 on page 45 gives an overview of how each conversion pair is handled.
In general, PostScript (as described in [1]) is used as a basis for most of the cal-
culations, since it supports the color models rgb, cmyk, hsb, and gray natively.
Furthermore, Alvy Ray Smith’s paper [15] is cited in [1] as reference for hsb-related
formulas.
First, we define a constant which is being used throughout the conversion formulas:

E := (1, 1, 1) (28)

6.3.1 The rgb model


Conversion rgb to cmy Source: [1], p. 475.

(cyan, magenta, yellow) := E − (red, green, blue) (29)


xcolor v3.02 (2024/09/29) 48

Conversion rgb to hsb (1) We set

x := max{red, green, blue} (30)


y := med{red, green, blue} (31)
z := min{red, green, blue} (32)
(33)

where ‘med’ denotes the median of the values. Then,

brightness := x (34)

Case x = z:

saturation := 0 (35)
hue := 0 (36)

Case x ̸= z:
x−z
saturation := (37)
x
x−y
f := (38)
x−z



 1−f if x = red ≥ green ≥ blue = z

if x = green ≥ red ≥ blue = z




 1+f

1  3−f if x = green ≥ blue ≥ red = z
hue := · (39)
6 3 + f
 if x = blue ≥ green ≥ red = z


5−f if x = blue ≥ red ≥ green = z





5+f if x = red ≥ blue > green = z

This is based on [15], RGB to HSV Algorithm (Hexcone Model), which reads
(slightly reformulated):
x − red x − green x − blue
r := , g := , b := (40)
x−z x−z x−z


 5+b if red = x and green = z

1−g




 if red = x and green > z

1  1+r if green = x and blue = z
hue := · (41)
6 3 − b
 if green = x and blue > z


3+g if blue = x and red = z





5−r if blue = x and red > z

Note that the singular case x = z is not covered completely in Smith’s original
algorithm; we stick here to PostScript’s behaviour in real life.
Because we need to sort three numbers in order to calculate x, y, z, several com-
parisons are involved in the algorithm. We present now a second method which is
more suited for TEX.
xcolor v3.02 (2024/09/29) 49

Conversion rgb to hsb (2) Let β be a function that takes a Boolean expression
as argument and returns 1 if the expression is true, 0 otherwise; set
i := 4 · β(red ≥ green) + 2 · β(green ≥ blue) + β(blue ≥ red), (42)

and

Φ(blue, green, red, 3, 1)

 if i = 1

Φ(green, red, blue, 1, 1)

 if i = 2


Φ(green, blue, red, 3, −1) if i = 3



(hue, saturation, brightness) := Φ(red, blue, green, 5, 1) if i = 4 (43)

Φ(blue, red, green, 5, −1) if i = 5








 Φ(red, green, blue, 1, −1) if i = 6

(0, 0, blue) if i = 7

where
 u · (x − z) + v · (x − y) x − z 
Φ(x, y, z, u, v) := , ,x (44)
6(x − z) x
The singular case x = z, which is equivalent to red = green = blue, is covered here
by i = 7.
It is not difficult to see that this algorithm is a reformulation of the previous
method. The following table explains how the transition from equation (39) to
equation (43) works:
6 · hue Condition red ≥ green green ≥ blue blue ≥ red i
1−f red ≥ green ≥ blue 1 1 ∗ 6/7
1+f green ≥ red ≥ blue ∗ 1 ∗ 2/3/6/7
3−f green ≥ blue ≥ red ∗ 1 1 3/7
3+f blue ≥ green ≥ red ∗ ∗ 1 1/3/5/7
5−f blue ≥ red ≥ green 1 ∗ 1 5/7
5+f red ≥ blue ≥ green 1 ∗ ∗ 4/5/6/7
Here, ∗ denotes possible 0 or 1 values. Bold i values mark the main cases where
all ∗ values of a row are zero. The slight difference to equation (39) in the last
inequality is intentional and does no harm.

Conversion rgb to gray Source: [1], p. 474.


gray := 0.3 · red + 0.59 · green + 0.11 · blue (45)

Conversion rgb to RGB As described in section 6.2.1 on page 46.



(Red, Green, Blue) := ΓL (red), ΓL (green), ΓL (blue) (46)

Conversion rgb to HTML As described in section 6.2.1 on page 46. Convert


to 6-digit hexadecimal afterwards. Certainly, multiplication and summation can
be replaced by simple text concatenation of 2-digit hexadecimals.

RRGGBB := 65536 · ΓL (red) + 256 · ΓL (green) + ΓL (blue) hex (47)
xcolor v3.02 (2024/09/29) 50

Complement of rgb color We simply take the complementary vector:

(red∗ , green∗ , blue∗ ) := E − (red, green, blue) (48)

6.3.2 The cmy model


Conversion cmy to rgb This is simply a reversion of the rgb → cmy case, cf.
section 6.3.1 on page 47.

(red, green, blue) := E − (cyan, magenta, yellow) (49)

Conversion cmy to cmyk This is probably the hardest of our conversion tasks:
many sources emphasize that there does not exist any universal conversion algo-
rithm for this case because of device-dependence. The following algorithm is an
extended version of the one given in [1], p. 476.

k := min{cyan, magenta, yellow} (50)


cyan := min{1, max{0, cyan − UCRc (k)}} (51)
magenta := min{1, max{0, magenta − UCRm (k)}} (52)
yellow := min{1, max{0, yellow − UCRy (k)}} (53)
black := BG(k) (54)

Here, four additional functions are required:

UCRc , UCRm , UCRy : [0, 1] → [−1, 1] undercolor-removal


BG : [0, 1] → [0, 1] black-generation

These functions are device-dependent, see the remarks in [1]. Although there are
some indications that they should be chosen as nonlinear functions, as long as we
have no further knowledge about the target device we define them linearly:

UCRc (k) := βc · k (55)


UCRm (k) := βm · k (56)
UCRy (k) := βy · k (57)
BG(k) := βk · k (58)

\adjustUCRBG where the parameters are given by \def\adjustUCRBG{⟨βc ⟩,⟨βm ⟩,⟨βy ⟩,⟨βk ⟩} at
any point in a document, defaulting to {1, 1, 1, 1}.

Conversion cmy to gray This is derived from the conversion chain cmy →
rgb → gray.

gray := 1 − (0.3 · cyan + 0.59 · magenta + 0.11 · yellow) (59)

Complement of cmy color We simply take the complementary vector:

(cyan∗ , magenta∗ , yellow∗ ) := E − (cyan, magenta, yellow) (60)


xcolor v3.02 (2024/09/29) 51

6.3.3 The cmyk model


Conversion cmyk to cmy Based on [1], p. 477, in connection with rgb → cmy
conversion.
cyan := min{1, cyan + black} (61)
magenta := min{1, magenta + black} (62)
yellow := min{1, yellow + black} (63)

Conversion cmyk to gray Source: [1], p. 475.


gray := 1 − min{1, 0.3 · cyan + 0.59 · magenta + 0.11 · yellow + black} (64)

Complement of cmyk color The simple vector complement does not yield
useful results. Therefore, we first convert C = (cyan, magenta, yellow, black) to
the cmy model, calculate the complement there, and convert back to cmyk.

6.3.4 The hsb model


Conversion hsb to rgb
(red, green, blue) := brightness · (E − saturation · F ) (65)

with

i := ⌊6 · hue⌋ , f := 6 · hue − i (66)

and



(0, 1 − f, 1) if i = 0

(f, 0, 1) if i = 1





(1, 0, 1 − f ) if i = 2



F := (1, f, 0) if i = 3 (67)

(1 − f, 1, 0) if i = 4









(0, 1, f ) if i = 5

(0, 1, 1) if i = 6

This is based on [15], HSV to RGB Algorithm (Hexcone Model), which reads
(slightly reformulated):
m := 1 − saturation (68)
n := 1 − f · saturation (69)
k := 1 − (1 − f ) · saturation (70)


 (1, k, m) if i = 0, 6





 (n, 1, m) if i = 1

(m, 1, k) if i = 2
(red, green, blue) := brightness · (71)


 (m, n, 1) if i = 3

(k, m, 1) if i = 4





(1, m, n) if i = 5

xcolor v3.02 (2024/09/29) 52

Note that the case i = 6 (which results from hue = 1) is missing in Smith’s
algorithm. Because of

lim (0, 1, f ) = (0, 1, 1) = lim (0, 1 − f, 1) (72)


f →1 f →0

it is clear that there is only one way to define F for i = 6 in order to get a
continuous function, as shown in equation (67). This has been transformed back
to equation (71). A similar argument shows that F indeed is a continuous function
of hue over the whole range [0, 1].

Conversion hsb to Hsb Only the first component has to be changed.

(hue◦ , saturation, brightness) := (H · hue, saturation, brightness) (73)

Conversion hsb to HSB As described in section 6.2.1 on page 46.



(Hue, Saturation, Brightness) := ΓM (hue), ΓM (saturation), ΓM (brightness) (74)

Complement of hsb color We have not found a formula in the literature,


therefore we give a short proof afterwards.
Lemma 3. The hsb-complement can be calculated by the following formulas:

hue + 1 if hue < 1
2 2
hue∗ := (75)
hue − 1 if hue ≥ 1
2 2

brightness∗ := 1 − brightness · (1 − saturation) (76)



0
 if brightness∗ = 0

saturation := brightness · saturation (77)
 if brightness∗ ̸= 0
brightness∗

Proof. Starting with the original color C = (h, s, b), we define color C ∗ =
(h∗ , s∗ , b∗ ) by the given formulas, convert both C and C ∗ to the rgb model and
show that
∗ !
Crgb + Crgb = b · (E − s · F ) + b∗ · (E − s′ · F ∗ ) = E, (78)

which means that Crgb is the complement of Crgb . First we note that the pa-
rameters of C are in the legal range [0, 1]. This is obvious for h∗ , b∗ . From

b∗ = 1 − b · (1 − s) = 1 − b + b · s we derive b · s = b∗ − (1 − b) ≤ b∗ , therefore
s∗ ∈ [0, 1], and

b∗ = 0 ⇔ s = 0 and b = 1.

Thus, equation (78) holds in the case b∗ = 0. Now we assume b∗ ̸= 0, hence


 b·s 
Crgb + Crgb = b · (E − s · F ) + b∗ · E − ∗ · F ∗
b
= b · E − b · s · F + b∗ · E − b · s · F ∗
= E − b · s · (F + F ∗ − E)
xcolor v3.02 (2024/09/29) 53

since b∗ = 1 − b + bs. Therefore, it is sufficient to show that

F + F ∗ = E. (79)

From

h< 1
2 ⇒ h∗ = h + 1
2 ⇒ 6h∗ = 6h + 3 ⇒ i∗ = i + 3 and f ∗ = f

it is easy to see from (67) that equation (79) holds for the cases i = 0, 1, 2.
Similarly,

h≥ 1
2 ⇒ h∗ = h − 1
2 ⇒ 6h∗ = 6h − 3 ⇒ i∗ = i − 3 and f ∗ = f

and again from (67) we derive (79) for the cases i = 3, 4, 5. Finally, if i = 6 then
f = 0 and F + F ∗ = (0, 1, 1) + (1, 0, 0) = E.

6.3.5 The Hsb model


Conversion Hsb to hsb Only the first component has to be changed.

(hue, saturation, brightness) := (hue◦ /H, saturation, brightness) (80)

Conversion Hsb to tHsb Under the settings of (82)–(84) we simply have to


exchange the letters x and y in equation (85) to get the inverse transformation:
xη − xη−1
hue◦ ∈ [yη−1 , yη ] ⇒ hue◦ := xη−1 + · (hue◦ − yη−1 ) (81)
yη − yη−1
while saturation and brightness are left unchanged.

6.3.6 The tHsb model


\rangeHsb Conversion tHsb to Hsb We assume that \rangeHsb = H and \rangetHsb
\rangetHsb expands to

x1 , y1 ; x2 , y2 ; . . . ; xh−1 , yh−1 (82)

where

x0 := 0 < x1 < x2 < · · · < xh−1 < xh := H (83)


y0 := 0 < y1 < y2 < · · · < yh−1 < yh := H (84)

with an integer h > 0. Now the x and y values determine a piecewise linear
transformation:
yη − yη−1
hue◦ ∈ [xη−1 , xη ] ⇒ hue◦ := yη−1 + · (hue◦ − xη−1 ) (85)
xη − xη−1
while saturation and brightness are left unchanged.

6.3.7 The gray model


Conversion gray to rgb Source: [1], p. 474.

(red, green, blue) := gray · E (86)


xcolor v3.02 (2024/09/29) 54

Conversion gray to cmy This is derived from the conversion chain gray →
rgb → cmy.

(cyan, magenta, yellow) := (1 − gray) · E (87)

Conversion gray to cmyk Source: [1], p. 475.

(cyan, magenta, yellow, black) := (0, 0, 0, 1 − gray) (88)

Conversion gray to hsb This is derived from the conversion chain gray →
rgb → hsb.

(hue, saturation, brightness) := (0, 0, gray) (89)

Conversion gray to Hsb/tHsb This is derived from the conversion chain


gray → hsb → Hsb, followed by Hsb → tHsb if applicable.

(hue◦ , saturation, brightness) := (0, 0, gray) (90)

Conversion gray to Gray As described in section 6.2.1 on page 46.

Gray := ΓN (gray) (91)

Complement of gray color This is similar to the rgb case:

gray∗ := 1 − gray (92)

6.3.8 The RGB model


Conversion RGB to rgb As described in section 6.2.2 on page 46.

(red, green, blue) := ∆L (Red), ∆L (Green), ∆L (Blue) (93)

6.3.9 The HTML model


Conversion HTML to rgb As described in section 6.2.2 on page 46: starting
with RRGGBB set

(red, green, blue) := ∆255 (RRdec ), ∆255 (GGdec ), ∆255 (BBdec ) (94)

6.3.10 The HSB model


Conversion HSB to hsb As described in section 6.2.2 on page 46.

(hue, saturation, brightness) := ∆M (Hue), ∆M (Saturation), ∆M (Brightness)
(95)

6.3.11 The Gray model


Conversion Gray to gray As described in section 6.2.2 on page 46.

gray := ∆N (Gray) (96)


xcolor v3.02 (2024/09/29) 55

6.3.12 The wave model


Conversion wave to rgb Source: based on Dan Bruton’s algorithm [4]. Let λ
be a visible wavelength, given in nanometers (nm), i.e., λ ∈ [380, 780]. We assume
further that γ > 0 is a fixed number (γ = 0.8 in [4]). First set

440 − λ
 

 , 0, 1 if λ ∈ [380, 440[



 440 − 380

  λ − 440 

 0, ,1 if λ ∈ [440, 490[
490 − 440




510 − λ 

 
 0, 1, if λ ∈ [490, 510[


(r, g, b) :=  510 − 490 (97)
 λ − 510 
, 1, 0 if λ ∈ [510, 580[


580 − 510




645 − λ

  
if λ ∈ [580, 645[


 1, ,0



 645 − 580


(1, 0, 0) if λ ∈ [645, 780]

then, in order to let the intensity fall off near the vision limits,
 λ − 380
 0.3 + 0.7 · if λ ∈ [380, 420[
420 − 380




f := 1 if λ ∈ [420, 700] (98)

0.3 + 0.7 · 780 − λ


if λ ∈ ]700, 780]

780 − 700

and finally

(red, green, blue) := (f · r)γ , (f · g)γ , (f · b)γ



(99)

The intermediate colors (r, g, b) at the interval borders of equation (97) are well-
known: for λ = 380, 440, 490, 510, 580, 645 we get magenta, blue, cyan, green,
yellow, red, respectively. These turn out to be represented in the hsb model
by hue = 65 , 46 , 36 , 26 , 16 , 06 , whereas saturation = brightness = 1 throughout the
6 colors. Furthermore, these hsb representations are independent of the actual
γ value. Staying within this model framework, we observe that the intensity
fall off near the vision limits — as represented by equation (98) — translates into
decreasing brightness parameters towards the margins. A simple calculation shows
that the edges λ = 380, 780 of the algorithm yield the colors magenta!0.3γ !black,
red!0.3γ !black, respectively. We see no reason why we should not extend these
edges in a similar fashion to end-up with true black on either side. Now we are
prepared to translate everything into another, more natural algorithm.

Conversion wave to hsb Let λ > 0 be a wavelength, given in nanometers (nm),


and let

ϱ : IR → [0, 1] , x 7→ min{1, max{0, x}})γ (100)


xcolor v3.02 (2024/09/29) 56

with a fixed correction number γ > 0. Then


  λ − 440 

 4 + ϱ if λ < 440



 380 − 440

  λ − 440 
4 − ϱ if λ ∈ [440, 490[




 490 − 440

  λ − 510 
1 2 + ϱ 490 − 510 if λ ∈ [490, 510[


hue := · (101)
6   λ − 510 
2 − ϱ if λ ∈ [510, 580[


580 − 510





  λ − 645 
if λ ∈ [580, 645[


 0+ϱ



 580 − 645


0 if λ ≥ 645

saturation := 1 (102)
λ − 380 
 

 ϱ 0.3 + 0.7 · if λ < 420
420 − 380




brightness := 1 if λ ∈ [420, 700] (103)

λ − 780

  

ϱ 0.3 + 0.7 ·
 if λ > 700
700 − 780
For the sake of completeness we note that, independent of γ,

 65 , 1, 0 if λ ≤ 380 − 3·(420−380)

7 = 362.857 . . .
(hue, saturation, brightness) =
if λ ≥ 780 + 3·(780−700)

0, 1, 0 = 814.285 . . .

7

What is the best (or, at least, a good) value for γ? In the original algorithm [4], γ =
0.8 is chosen. However, we could not detect significant visible difference between
the cases γ = 0.8 and γ = 1. Thus, for the time being, xcolor’s implementation
uses the latter value which implies a pure linear approach. In the pstricks examples
file xcolor2.tex, there is a demonstration of different γ values.
xcolor v3.02 (2024/09/29) 57

References
[1] Adobe Systems Incorporated: “PostScript Language Reference Manual”. Addison-Wesley,
third edition, 1999. http://www.adobe.com/products/postscript/pdfs/PLRM.pdf
[2] Donald Arseneau: “Patch so \fbox draws frame on top of text”. LATEX bug report,
latex/3655, 2004/03/18.
http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/3655
[3] Donald Arseneau: url package, “2005/06/27 ver 3.2 Verb mode for urls, etc.”.
CTAN/macros/latex/contrib/misc/url.sty
[4] Dan Bruton: “Approximate RGB values for Visible Wavelengths”, 1996.
http://www.physics.sfasu.edu/astro/color/spectra.html
[5] David P. Carlisle: “Packages in the ‘graphics’ bundle”, 2014.
CTAN/macros/latex/required/graphics/grfguide.*
[6] David P. Carlisle: color package, “2016/01/03 v1.1b Standard LaTeX Color (DPC)”.
CTAN/macros/latex/required/graphics/color.dtx
[7] David P. Carlisle: colortbl package, “2001/02/13 v0.1j Color table columns”.
CTAN/macros/latex/contrib/colortbl/
[8] David P. Carlisle, Herbert Voß, Rolf Niepraschk: pstcol package, “2005/11/16 v1.2 LaTeX
wrapper for ‘PSTricks’”. CTAN/macros/graphics/pstricks/latex/pstcol.sty
[9] Uwe Kern: “Chroma: a reference book of LATEX colors”. CTAN/info/colour/chroma/ and
http://www.ukern.de/tex/chroma.html
[10] Uwe Kern: xcolor package, “LATEX color extensions”.
CTAN/macros/latex/contrib/xcolor/ and http://www.ukern.de/tex/xcolor.html
[11] MiKTEX Project: http://www.miktex.org/
[12] Rolf Niepraschk: colorinfo package, “2003/05/04 v0.3c Info from defined colors”.
CTAN/macros/latex/contrib/colorinfo/
[13] Heiko Oberdiek: pdfcolmk package, “2006/02/20 v0.8 PDFtex COLor MarK”.
CTAN/macros/latex/contrib/oberdiek/pdfcolmk.*
[14] Sebastian Rahtz, Heiko Oberdiek: hyperref package, “2006/09/06 v6.75e Hypertext links for
LATEX”. CTAN/macros/latex/contrib/hyperref/
[15] Alvy Ray Smith: “Color Gamut Transform Pairs”. Computer Graphics (ACM SIGGRAPH),
Volume 12, Number 3, August 1978. http://alvyray.com/Papers/PapersCG.htm
[16] World Wide Web Consortium: “HTML4 color keywords”.
http://www.w3.org/TR/css3-color/#html4
[17] World Wide Web Consortium: “Scalable Vector Graphics (SVG) 1.1 Specification — Basic
Data Types and Interfaces”. http://www.w3.org/TR/SVG11/types.html#ColorKeywords
xcolor v3.02 (2024/09/29) 58

Appendix

Acknowledgement to the colortbl package and is no longer


defined by xcolor.
This package is based on and contains code
copied from [6] (Copyright (C) 1994–1999 • The fixpdftex option is obsolete and does
David P. Carlisle), which is part of the Stan- nothing at all (issue #20)
dard LATEX ‘Graphics Bundle’. Although many • Extended \normalcolor to set also the dot
commands and features have been added and color, issue #19
most of the original color commands have been • Fix Gray color model, issue #23
rewritten or adapted within xcolor, the latter
package would not exist without color. Thus, 2022/06/12 v2.14
the author is grateful to David P. Carlisle
for having created color and its accompanying • Load code from LATEX to define
files. \mathcolor if it is available.
• Bug fixes:
Trademarks – Modify \XC@info to avoid spurious error
from \colorlet{foo}{}, issue #12
Trademarks appear throughout this documen- – make \normalcolor, \colorbox,
tation without any trademark symbol; they \fcolorbox, \textcolor, \pagecolor,
are the property of their respective trademark \nopagecolor, \definecolor,
owner. There is no intention of infringement; \DefineNamedColor protected as in
the usage is to the benefit of the trademark color.sty, issue #17
owner.
2021/10/31 v2.13
Known Issues
• Bug Fixes:
• \rowcolors[\hline]... does not work – Avoid use of \string to generate
with longtable. csnames
– Declare dvisvgm option and make
History dvipdfm an alias to dvipdfmx to match
graphics and color packages.
2023/11/15 v3.01 – Modify \XC@info to avoid spurious text
• only warn and not error if obsolete option from \colorlet{foo}{.!50}
usenames is used (issue #31)
2016/05/11 v2.12
2023/11/11 v3.00 • New features:

• if a LATEX older than 2022-06-01 is detected – \nopagecolor command as introduced in


a frozen version is used. All new features color v1.1a (example added to
apply only if LaTeX 2022-06-01 or newer is xcolor3.tex);
detected. The frozen version can also be – luatex driver option (code provided by
requested with DPC) to fix incompatibilities due to
\usepackage{xcolor}[=v2] changes in new LuaTEX version.

• The new LaTeX key/val handler is used for • Bugfixes:


the package options. That means there will – possible name conflict by \XC@ifxcase
be fewer option clash errors (issue #29). call;
item The \rowcolors command has moved – incorrect internal \@hex@@Hex macro.
xcolor v3.02 (2024/09/29) 59

2007/01/21 v2.11 – more flexibility for \fcolorbox


arguments, e.g., \fcolorbox
• New features: [gray]{0.5}[wave]{580}{test};
– color names lime and teal added to the – \boxframe returns a frame of given
set of predefined colors. dimensions;
• Bugfix: – new implementation of \f(rame)box and
\fcolorbox as an extension of bug
– incorrect \XC@strip@comma call within
report latex/3655 to reduce pixel
hyperref-related options.
positioning errors in output devices;
– kernelfbox option for those who prefer
2006/11/28 v2.10 the previous \f(rame)box approach;
• New features: – experimental xcdraw option uses
PostScript commands to draw frames
– fixinclude option prevents dvips from
and color boxes in case of dvips.
explicitly resetting current color to black
before actually inserting an .eps file via • Bugfixes:
\color{red}\includegraphics{foo}. – insufficient expression type detection
• Changes: within \colorlet;
– \colorbox and \fcolorbox made robust; – wrong calculation in the unit interval
reduction for negative integers (affecting
– obsolete package option pst removed; color series and extended color
– several changes to internal macros. expressions).
• Bugfixes:
– incorrect processing of cmyk-type 2005/11/12 v2.07
current color ‘.’. • New features:
– color model Hsb allows to specify hue in
2005/12/21 v2.09 degrees;
• New features: – color model tHsb (tuned Hsb) for
user-defined hue configuration on color
– \definecolor and \color now accept wheels;
space-separated color specifications, e.g.,
– easy generation of color harmonies
\color [rgb]{1 .5 0};
derived from Hsb or tHsb color wheels,
– experimental xcdraw option extended to e.g., \color{red>wheel,1,12} yields an
pdftex and dvipdfm drivers. ‘analogous’ color to red on a 12-spoke
• Changes: wheel;
– test file xcolor2.tex made compatible – additional 317 predefined color names
with recent changes in pstricks; according to rgb.txt, which is part of
Unix/X11 distributions;
– test file xcolor3.tex extended;
– svgnames option extended by 4 colors
– driver test file xcolor4.tex extended to
taken from rgb.txt;
demonstrate the different frame drawing
approaches; – enhanced syntax for immediate
conversion, e.g., \definecolor
– more efficient implementation of
{foo}{rgb:gray}{0.3} or \color
driver-specific code.
[rgb:wave]{478};
– \@ifundefinedcolor and
2005/11/25 v2.08 \@ifundefinedmodel commands;
• New features: • Changes:
xcolor v3.02 (2024/09/29) 60

– enhanced documentation; 2005/09/23 v2.04


– several changes to internal macros.
• Bugfixes: • New features:
– wrong calculation of color series – preparation for usage of additional –
components in some cases of negative driver-provided – color models;
step parameters.
– pstricks users may now specify explicit
color parameters within \psset and
2005/10/15 v2.06
related commands, e.g.,
• New features: \psset{linecolor=[rgb]{1,0,0}}; an
– color model wave for (approximate) illustrative example is given in
visualisation of light wavelengths, still xcolor2.tex.
somewhat experimental;
• Changes:
– pseudo-model ‘ps’ for colors defined by
literal PostScript code in conjunction – color model names sanitized (i.e., turned
with pstricks and dvips; an illustrative to catcode 12) throughout the package;
example for a γ-correction approach is
– \@namelet command deprecated because
given in xcolor2.tex;
of name clash with memoir — please use
– \substitutecolormodel command for
\XC@let@cc instead (more \XC@let@..
replacement of missing or faulty
commands are available as well);
driver-specific color models;
– improved detection and handling of – simplified color conversion code by using
driver-specific color models; the new \XC@ifxcase command;
– dvipdfmx and xetex options to support – some minor changes to internal macros.
these drivers;
– generic driver test file xcolor4.tex.
• Changes: 2005/06/06 v2.03
– \XC@strip@comma doesn’t generate a
trailing space anymore, which improves • New features:
also the output of the testcolors
environment. – fixpdftex option loads pdfcolmk
package in order to improve pdfTEX’s
color behaviour during page breaks.
2005/09/30 v2.05
• New features: • Changes:
– testcolors environment helps to test – some minor changes to internal macros.
colors in different models, showing both
the visual result and the model-specific • Bugfixes:
parameters;
– \extractcolorspecs puts model/color – due to an incorrect \if statement within
specification into two separate \XC@info, \colorlet caused trouble
commands, as opposed to whenever its second argument started
\extractcolorspec; with two identical letters, e.g.,
– color names pink and olive added to the \colorlet{rab}{oof};
set of predefined colors. – argument processing of \XC@getcolor
• Bugfixes: caused incompatibility with msc package;
– \definecolor{foo}{named}{bar} did – prologue option caused incompatibility
not work in v2.04. with preview package.
xcolor v3.02 (2024/09/29) 61

2005/03/24 v2.02 especially useful (= memory saving) for


large lists of colors, of which only a few
• New features:
names are actually used;
– \aftergroupedef command to – dvipsnames* and svgnames* options to
reproduce \aftergroupdef’s behaviour support deferred definition.
prior to v2.01;
• Changes:
– xcolor’s homepage
www.ukern.de/tex/xcolor.html now – higher accuracy: most complement
provides also a ready-to-run calculations are now exact for all 5-digit
TDS-compliant archive containing all decimals;
required files. – \rangeRGB and similar variables may now
• Changes: be changed at any point in a document;
– \aftergroupdef now performs only a
– \rowcolors and friends are solely
first-level expansion of its code argument;
enabled by the table option;
– \XCfileversion and similar internal
– \@ifxempty changed back to more
constants removed from .sty and .def
robust variant of v2.00.
files;
• Bugfixes: – improved memory management (reduced
– \psset{linecolor=\ifcase\foo generation of ‘multiletter control
red\or green\or blue\fi} did not sequences’ by \@ifundefined tests);
work with pstricks (error introduced in – several internal macros improved and/or
v2.01). renamed.
• Bugfixes:
2005/03/15 v2.01
– \XC@getcolor could cause unwanted
• New features: spaces when \psset was used inside
– prologue option for comprehensive pspicture environments (pstricks);
‘named’ color support in conjunction – arithmetic overflow could happen when
with dvips: on-the-fly generation of too many decimal digits were used within
PostScript prologue files with all color color parameters, e.g., as a result of fp
definitions, ready for dvips inclusion calculations.
and/or post-processing with
device-specific parameters (e.g., spot 2004/07/04 v2.00
colors);
• New features:
– dvips prologue file xcolor.pro to
support additional ‘named’ colors; – extended functionality for color
– \colorlet may now also be used to expressions: mix colors like a painter;
create named colors from arbitrary color – support for color blending: specify color
expressions; mix expressions that are being blended
– enhanced color definition syntax to allow with every displayed color;
for target-model specific color – \xglobal command for selective control
parameters, e.g., \definecolor of globality for color definitions, blends,
{red}{rgb/cmyk}{1,0,0/0,1,1,0}, and masks;
facilitating the usage of tailor-made – multiple step operations (e.g.,
colors both for displays and printers; \color{foo!!+++}) and access to
– ‘deferred definition’ of colors: individual members (e.g.,
\preparecolor and \definecolors \color{foo!![7]}) in color series;
enable decoupling of color specification – \providecolor command to define only
and control sequence generation, non-existent colors;
xcolor v3.02 (2024/09/29) 62

– \definecolorset and – \XC@logcolor renamed to \XC@display,


\providecolorset commands to which is now the core color display
facilitate the construction of color sets command;
with common underlying color model; – improved interface to pstricks.
– additional 147 predefined color names
according to SVG 1.1 specification; 2004/03/27 v1.10
– xpdfborder key for setting the width of
• New features:
hyperlink borders in a more
driver-independent way if dvips is used. – support for ‘named’ model;
– support for dvips colors (may now be
• Changes:
used within color expressions);
– color package now completely integrated – internal representation of ‘ordinary’ and
within xcolor; ‘named’ colors merged into unified data
– override, usenames, nodvipsnames structure;
options and \xdefinecolor command no – allow multiple ‘-’ signs at the beginning
longer needed; of color expressions.
– dvips and dvipsnames options now • Bugfixes:
independent of each other;
– commands like \color[named]{foo}
– \tracingcolors’s behaviour changed to caused errors when color masking or
make it more versatile and reduce log file target model conversion were active;
size in standard cases; – incompatibility with soul package:
– \rdivide’s syntax made more flexible commands \hl, \ul, etc. could yield
(divide by numbers and/or dimensions); unexpected results.
– code restructured, some internal • Documentation:
commands renamed;
– added formula for general color
– documentation rearranged and enhanced. expressions;
• Bugfixes: – enhanced text and index;
– \definecolor{foo}{named}{bar} did – removed dependence of index generation
not work (error introduced in v1.11); on local configuration file.
– more robust behaviour of conditionals
within pstricks key-values. 2004/02/16 v1.09
• New features:
2004/05/09 v1.11
– color model HTML, a 24-bit hexadecimal
• New features: RGB variant; allows to specify colors like
– switch \ifglobalcolors to control \color[HTML]{AFFE90};
whether color definitions are global or – color names orange, violet, purple, and
local; brown added to the set of predefined
– option hyperref provides color colors.
expression support for the border colors • New xcolor homepage:
of hyperlinks, e.g., \hypersetup www.ukern.de/tex/xcolor.html
{xurlbordercolor=red!50!yellow}; • Bugfix: \xdefinecolor sometimes did not
– internal hooks \XC@bcolor, \XC@mcolor, normalise its parameters.
and \XC@ecolor for additional code that • Changes:
has to be executed immediately – slight improvements of the
before/after the current color is being documentation;
displayed. – example file xcolor1.tex reorganised
• Changes: and abridged.
xcolor v3.02 (2024/09/29) 63

2004/02/04 v1.08 • Bugfix: color series stepping did not work


correctly within non-displaying commands
• New commands: like \extractcolorspec{foo!!+} (this
– \selectcolormodel to change the target bug was introduced in v1.05).
model within a document;
• Renamed commands: \ukfileversion and
– \adjustUCRBG to fine-tune similar internal constants renamed to
undercolor-removal and black-generation \XCfileversion etc.
during conversion to cmyk.
• Removed commands: \ifXCpst and
• Bugfix: color expressions did not work
\ifXCtable made obsolete by a simple
correctly in connection with active ‘!’
trick.
character, e.g., in case of
\usepackage[frenchb]babel}.
• Code re-organisation: 2003/11/21 v1.05
– \XC@xdefinecolor merged into • Bugfixes:
\xdefinecolor, making the first
command obsolete; – package option hideerrors should now
– several internal commands work as expected;
improved/streamlined. – usage of ‘.’ in the first color expression in
a document caused an error due to
2004/01/20 v1.07 incorrect initialisation.

• New feature: support for color masking and • Code re-organisation: \extractcolorspec
color separation. now uses \XC@splitcolor, making
\XC@extract obsolete.
• New commands:
– \rmultiply to multiply a dimension
register by a real number; 2003/11/09 v1.04
– \xcolorcmd to pass commands that are • New feature: easy access to current color
to be executed at the end of the package. within color expressions.
• Changes: • New option: override to replace
– more consistent color handling: extended \definecolor by \xdefinecolor.
colors now always take precedence over
• New command: \tracingcolors for
standard colors;
logging color-specific information.
– several commands improved by using
code from the LATEX kernel.
• Documentation: some minor changes. 2003/09/21 v1.03
• Example files: additional pstricks examples • Change: bypass strange behaviour of some
(file xcolor2.tex). drivers.
• New feature: driver-sharing with hyperref.
2003/12/15 v1.06
• New feature: extended color expressions,
allowing for cascaded mix operations, e.g., 2003/09/19 v1.02
\color{red!30!green!40!blue}. • Change: \extractcolorspec and
• Documentation: new section on color \colorlet now also accept color series as
expressions. arguments.
xcolor v3.02 (2024/09/29) 64

2003/09/15 v1.01 – \@rdivide: added \relax to fix problem


with negative numerators;
• New feature: \definecolorseries and
friends. – \rowc@l@rs: replaced \@ifempty by
• Documentation: removed some doc-related \@ifxempty.
side-effects.
• Code re-organisation: all 2003/09/09 v1.00
calculation-related tools put to one place.
• Bugfixes: • First published release.

Index
Numbers written in italic refer to the page where the corresponding entry is described; numbers
underlined refer to the code line of the definition; numbers in roman refer to the code lines where
the entry is used.

A \blendcolors* . . . . . . . . . . 24 color names


\adjustUCRBG . . . . . . . . . 8, 50 \boxframe . . . . . . . . . . . . . 23 Fuchsia . . . . . . . . . . . . 30
arguments Gray0 . . . . . . . . . . . . . 18
⟨color expr ⟩ . . . . . . . 13, 15 C Green0 . . . . . . . . . . . . 18
⟨color ⟩ . . . . . . . . . . 13, 15 \color . . . . . . . . . . . . . . . . 22 Grey0 . . . . . . . . . . . . . 18
⟨core model ⟩ . . . . . . 12, 13 color expression . . . . . . . . 19 Maroon0 . . . . . . . . . . . 18
⟨dec⟩ . . . . . . . . . . . . 12, 13 color functions Purple0 . . . . . . . . . . . 18
⟨div ⟩ . . . . . . . . . . . . 12, 13 twheel . . . . . . . . . . . 16, 17 black 5, 8, 9, 17, 24, 55, 59
⟨empty⟩ . . . . . . . . . 12, 13 wheel . . . . . . . . . . . 16, 17 blue . . 5, 6, 17, 19, 20, 55
⟨expr ⟩ . . . . . . . . . . . 13, 14 color models brown . . . . . . . . . . . 17, 62
⟨ext expr ⟩ . . . . . . . . 13, 14 cyan . . . . . . 17, 24, 25, 55
Gray . . . . . 9–12, 41, 45, 54
⟨ext id ⟩ . . . . . . . . . . .. 13 darkgray . . . . . . . . . . . 17
HSB . . 9–12, 41, 45, 52, 54
⟨func expression⟩ . . . .. 15 foo . . . . . . . . . . . . . 19, 24
HTML . . . . . . . . . . 8–
⟨func expr ⟩ . . . . . . . .. 13 gold . . . . . . . . . . . . . . . 5
10, 12, 41, 45, 49, 54, 62
⟨function⟩ . . . . . . . . 13, 15 gray . . . . . . . . . . . . . 5, 17
Hsb . . . . . . . . . . 8, 10,
⟨id-list⟩ . . . . . . . . . . .. 13 green . . 4–6, 16, 17, 20, 55
12, 17, 36, 45, 52–54, 59
⟨id ⟩ . . . . . . . . . . . . .. 13 lightgray . . . . . . . . . . . 17
RGB . . . . . . . . . . . . 9–
⟨int⟩ . . . . . . . . . . . . 12, 13 lime . . . . . . . . . . . . 17, 59
12, 17, 41, 45, 49, 54, 62
⟨minus⟩ . . . . . . . . . 12, 13 magenta . . . . . . 17, 24, 55
⟨mix expr ⟩ . . . . . . . 13, 14 cmyk . . . . . . . 4, 5, 8– olive . . . . . . . . . . . . 17, 60
⟨model-list⟩ . . . . . . . 13, 14 10, 12, 17, 19, 24, 41, orange . . . . . . . . . . 17, 62
⟨model ⟩ . . . . . . . . . . 12, 13 45, 47, 50, 51, 54, 59, 63 pink . . . . . . . . . . . . 17, 60
⟨name⟩ . . . . . . . . . . 12, 13 cmy . . . . . . . 8–10, 12, purple . . . . . . . . . . . 17, 62
⟨num model ⟩ . . . . . . 12, 13 25, 41, 45, 47, 50, 51, 54 red . . . . . . . . . . 4–6, 8,
⟨num⟩ . . . . . . . . . . . 12, 13 gray . . . . . 5, 8–12, 16, 10, 16, 17, 19, 20, 55, 59
⟨pct⟩ . . . . . . . . . . . . 12, 13 41, 45, 47, 49–51, 53, 54 silver . . . . . . . . . . . . . . 5
⟨plus⟩ . . . . . . . . . . . 12, 13 hsb . . . 4, 8–12, 17, 19, teal . . . . . . . . . . . . 17, 59
⟨postfix ⟩ . . . . . . . . . 13, 14 41, 44, 45, 47–49, 51–55 violet . . . . . . . . . . . 17, 62
⟨prefix ⟩ . . . . . . . . . . 13, 14 rgb . . . . . . 5, 8–12, 17, white . . . . . . . . . . . . 5, 17
⟨spec-list⟩ . . . . . . . . 13, 14 19, 25, 27, 41, 45, 47–55 yellow 4, 6, 10, 16, 17, 24, 55
⟨spec⟩ . . . . . . . . . . . 13, 14 tHsb . . . . . . . . . . 8, 10, color set . . . . . . . . . . . . . . 20
⟨type⟩ . . . . . . . . . . . 13, 14 12, 17, 36, 45, 53, 54, 59 \colorbox . . . . . . . . . . . . . 22
wave . . . . 10–12, 45, 55, 60 \colorlet . . . . . . . . . . . . . 20
B ‘named’ . . . . . . . 12, 20, 62 \colormask . . . . . . . . . . . . 25
\blendcolors . . . . . . . . . . . 24 ‘ps’ . . . . . . . . . . . . . 12, 60 \colorseriescycle . . . . . . 26
xcolor v3.02 (2024/09/29) 65

\convertcolorspec . . . . . . 29 K fixinclude . . . 7, 9, 30, 59


keys fixpdftex . . . . . . . . . 9, 60
D citebordercolor . . . .... 27 gray . . . . . . . . . . . 7, 9, 11
\definecolor . . . . . . . . 19, 28 citecolor . . . . . . . .... 27 hideerrors . . . . . . 7, 9, 63
\definecolors . . . . . . . . . . 21 filebordercolor . . . .... 27 hsb . . . . . . . . . . . . 7, 9, 11
\definecolorseries . . . . . . 25 filecolor . . . . . . . . .... 27 hyperref . 7, 9, 27, 28, 62
\definecolorset . . . . . . . . 20 linkbordercolor . . . .... 27 hypertex . . . . . . . . . . . 7
\DefineNamedColor . . . . . . 21 linkcolor . . . . . . . .... 27 kernelfbox . . . 7, 9, 23, 59
definition stack . . . . . . . . . 21 menubordercolor . .... 27 luatex . . . . . . . . 7, 41, 58
menucolor . . . . . . .... 27 monochrome . . . . . . . . 7, 41
E pagebordercolor . . .... 27 natural . . . . . 7, 9, 11, 12
environments: pagecolor . . . . . . .... 27 noxcdraw . . . . . . . 7, 9, 23
testcolors . . . . . . . . . . 23 pdfborder . . . . . . .... 28 oztex . . . . . . . . . . . . 7, 41
\extractcolorspec . . . . . . 29 runbordercolor . . . .... 27 pctex32 . . . . . . . . . . 7, 41
\extractcolorspecs . . . . . . 29 runcolor . . . . . . . .... 27 pctexhp . . . . . . . . . . 7, 41
urlbordercolor . . . .... 27 pctexps . . . . . . . . . . 7, 41
F urlcolor . . . . . . . . .... 27 pctexwin . . . . . . . . . 7, 41
\fcolorbox . . . . . . . . . . . . 22 xcitebordercolor . . . . 27, 28 pdftex . . . . . . . . . . . .
files xfilebordercolor . . . . 27, 28 . 7, 19, 23, 32, 41, 43, 59
.def . . . . . . . . . . . . . 7, 61 xlinkbordercolor . . . . 27, 28 prologue 7, 9, 18, 19, 60, 61
.dvi . . . . . . 18, 19, 23, 28 xmenubordercolor . . 27, 28 rgb . . . . . . . . . . . . 7, 9, 11
.eps . . . . . . . 9, 25, 30, 59 xpagebordercolor . . . 27, 28 showerrors . . . . . . . . 7, 9
.jpg . . . . . . . ....... 25 xpdfborder . . . . . 27, 28, 62 svgnames* . 7, 9, 17, 21, 61
.pdf . . . . . . . ....... 25 xrunbordercolor . . . . 27, 28 svgnames . . . . . . . . 7,
.png . . . . . . . ....... 25 xurlbordercolor . . . . 27, 28 9, 17, 18, 21, 30, 38, 59
.ps . . . . . . . . . . 19, 28, 30 table . . . . 7, 9, 10, 28, 61
M
.sty . . . . . . . ....... 61 tcidvi . . . . . . . . . . . 7, 41
\maskcolors . . . . . . . . . . . . 25
.xcp . . . . . . . . . . . . . 9, 18 textures . . . . . . . . . 7, 41
MiKTEX . . . . . . . . . . . . . . 19
color.pro . . . ....... 18 truetex . . . . . . . . . . 7, 41
dvipsnam.def ....... 21 usecolors . . . . . . . . . . 42
N
rgb.txt . . . . . . . . . 17, 59 vtex . . . . . . . . . . . . . 7, 41
\nopagecolor . . . . . . . . . . . 22
xcolor.pro . . . . . 7, 18, 61 x11names* . . . . . . . 7, 9, 17
xcolor.sty . . . . . . . . 7, 17 P x11names . . . . 7, 9, 17, 39
xcolor2.tex . ....... package options xcdraw . . . . . . 7, 9, 23, 59
. . . . . 28, 56, 59, 60, 63 Gray . . . . . . . . . . . 7, 9, 11 xdvi . . . . . . . . . . . . . 7, 41
xcolor3.tex . . . . . . 58, 59 HSB . . . . . . . . . . . . 7, 9, 11 xetex . . . . . . . . . 7, 41, 60
xcolor4.tex . . . . . . 59, 60 HTML . . . . . . . . . . . 7, 9, 11 package options (obsolete)
RGB . . . . . . . . . . . . 7, 9, 11 fixpdftex . . . . . . . . . . . 7
G cmyk . . . . . . . . 7, 9, 11, 24 hyperref . . . . . . . . . . . 7
\GetGinDriver . . . . . . . . . . 7 cmy . . . . . . . . . . . . 7, 9, 11 nodvipsnames . . . . . . 7, 62
\GinDriver . . . . . . . . . . . . 7 dvipdfmx . . . . . . 7, 41, 60 override . . . . . . 7, 62, 63
dvipdfm . 7, 19, 23, 41, 59 pst . . . . . . . . . . . . . . 7, 59
H dvipdf . . . . . . . . . . . 7, 41 usenames . . . . . . 7, 43, 62
\hiderowcolors . . . . . . . . . 29 dvipsnames* . . 7, 9, 17, 61 packages
HKS . . . . . . . . . . . . . . . . . 5 dvipsnames . . . . . . . . . colorinfo . . . . . . . . . 42, 57
HTML4 . . . . . . . . . . . . 17, 39 . . 7–9, 17–19, 30, 38, 62 colortbl . . . . . 9, 10, 28, 57
dvipsone . . . . . . . . . 7, 41 color . . . . . . . . . . . . 4,
I dvips . . . . . . . . . 7, 18, 7, 9, 10, 18, 19, 21–23,
\ifconvertcolorsD . . . . . . 11 19, 23, 28, 41, 43, 59–62 27, 29, 41–43, 57, 58, 62
\ifconvertcolorsU . . . . . . 11 dvisvgm . . . . . . . . . . . . 7 doc . . . . . . . . . . . . . . . 64
\ifdefinecolors . .. . . . . . 21 dviwindo . . . . . . . . . 7, 41 fp . . . . . . . . . . . . . . 42, 61
\ifglobalcolors . .. . . . . . 21 dviwin . . . . . . . . . . . 7, 41 graphics . . . . . . . . . . 18, 30
\ifmaskcolors . . . .. . . . . . 25 emtex . . . . . . . . . . . . 7, 41 graphicx . . . . . . . . . . . 30
xcolor v3.02 (2024/09/29) 66

hyperref . . . . . . . . . 7, Niepraschk, Rolf . . . . . 57 \rowcolors* . . . . . . . . . . . . 29


9, 10, 27, 28, 57, 59, 63 Oberdiek, Heiko . . . . . 57 \rownum . . . . . . . . . . . . . . . 29
longtable . . . . . . . . . . . 58 Rahtz, Sebastian . . . . . 57
memoir . . . . . . . . . . . . 60 Smith, Alvy Ray . . . 47, 57 S
msc . . . . . . . . . . . . . . . 60 Voß, Herbert . . . . . . . . 57 \selectcolormodel . . . . . . 11
pdfcolmk . . . . . . . . . 57, 60 PostScript . . 8, 12, 18, 19, shade . . . . . . . . . . . . . . . . . 5
preview . . . . . . . . . . . . 60 23, 28, 30, 47, 48, 59–61 \showrowcolors . . . . . . . . . 29
pstcol . . . . . . . . . . . 10, 57 \preparecolor . . . . . . . . . . 21 spot color . . . . . . . . . . . . . . 5
pstricks 10, 19, 28, 56, 59–63 \preparecolorset . . . . . . . 21 \substitutecolormodel . . . 11
realcalc . . . . . . . . . . . . 42 programs SVG . . . . . 9, 17, 18, 30, 57, 62
soul . . . . . . . . . . . . . 22, 62 Yap . . . . . . . . . . . . . . . 19
url . . . . . . . . . . . . . . . 57 dvipdfm . . . . . . . . . . . . 19 T
xcolor 1, 4, 7, 8, 10–12, dvips . . . . . . . . . . . . 7, \testcolor . . . . . . . . . . . . 24
17–21, 23, 25, 26, 28– 18, 19, 28, 30, 59, 61, 62 testcolors (env.) . . . . . . . . 23
30, 41–43, 56–58, 61, 62 \providecolor . . . . . . . . . . 19 \textcolor . . . . . . . . . . . . 22
\pagecolor . . . . . . . . . . . . 22 \providecolors . . . . . . . . . 21 tint . . . . . . . . . . . . . . . . . . 5
Pantone . . . . . . . . . . . . . . . 5 \providecolorset . . . . . . . 20 tone . . . . . . . . . . . . . . . . . . 5
PDF . . . . . . . . . . . . . . . . 23 \tracingcolors . . . . . . . . . 29
people R
Arseneau, Donald . . 23, 57 \rangeGray . . . . . .. . . . . . 11 U
Bruton, Dan . . . . . . 55, 57 \rangeHSB . . . . . . .. . . . . . 11 Unix . . . . . . . . . 9, 17, 39, 59
Carlisle, David P. . . 57, 58 \rangeHsb . . . . . . .. . . . 8, 53
Goethe, Johann Wolfgang \rangeRGB . . . . . . .. . . . . . 11 X
von . . . . . . . . . . . . . 5 \rangetHsb . . . . . .. . . 10, 53 X11 . . . . . . . 9, 17, 18, 39, 59
Kern, Uwe . . . . . . . . . 57 \resetcolorseries . . . . . . 26 \xcolorcmd . . . . . . . . . . . . 8
Newton, Isaac . . . . . . . . 5 \rowcolors . . . . . .. . . . . . 29 \xglobal . . . . . . . . 21, 24, 25

You might also like