# Colors known to PDF

Where can all the supported colors be found for LaTeXPDF? I have looked at a few articles to find that they only work in dvips.

Here is one: Colors in TeX.

Is there a place where they list all the colors that will execute when using LaTeX --> PDF (TeXnicCenter)?

EDIT:

Here is a mbe (minimum broke example)

\documentclass[a4paper]{article}

\usepackage[usenames]{xcolor}

\begin{document}

\begin{center} \underline{\textcolor{BrickRed}{Fourier Sine Series}} \end{center}

\end{document}


I tried this BrickRed and MidnightBlue, and both came up as undefined control sequences.

-
You mean what color names are provides? Either LaTeX (using the xcolor package of course) and PDF should support all colors representable using the RGB and CMYK color models. –  Martin Scharrer Aug 12 '11 at 14:07
With "LaTeX --> PDF" you mean creating the PDF directly with pdflatex or using latex->dvi->dvipdfm or similar? –  Martin Scharrer Aug 12 '11 at 14:15
@Martin: Not so sure. I have the option of the editor that has LATEX --> PDF? So I don't think it goes through the dvi. –  night owl Aug 12 '11 at 14:58

There are two problems with your minimal example:

1. doecumentclass should be documentclass.
2. To use the colors in the “Colors via dvipsnames option”, you have to explicitly invoke the dvipsnames package option (as the name of the section implies). This is also stated in section “2.1.2 Package options”. The usenames options is depreciated and doesn't do anything in current versions of xcolor.

\documentclass[a4paper]{article}
\usepackage[dvipsnames]{xcolor}

\begin{document}
\begin{center}
\underline{\textcolor{BrickRed}{Fourier Sine Series}}
\end{center}
\end{document}

-
Thanks a Ton!!! Caramdir again to the rescue. You hit the nail right on the head. So it was the option I was using on the color class package, I see. Lots to still learn about this LaTeX, it is so deep. :). Which manual are you referring to in section "2.1.2 Package options"? –  night owl Aug 12 '11 at 16:35
@night The xcolor one of course (v2.11). –  Caramdir Aug 12 '11 at 16:36
Oops, sorry, I didn't have my page scrolled up to see the xcolor, the last word of the paragraph. :p –  night owl Aug 12 '11 at 16:43

I assume you mean which color names are provides? Both LaTeX (using the modern xcolor package of course) and PDF should support all colors representable using the RGB and CMYK color models. Colors can be specified using numbers as well as names. You can also define your own color names for specific numeric colors.

A couple of color name tables can be found in the xcolor manual in section 4 "Colors by Name". The available names depend on the used package options, which however are also listed there.

If you use pdflatex the colors are added directly to the PDF and you don't need to worry about the color support of intermediate programs like dvips or dvipdfm. I would guess that dvipdfm supports at least the same colors than dvips (if these tools really have to support the color names themselves). However, not all output drivers for LaTeX support all color models and some only indirectly. See table 5: "Drivers and color models" in section 5.1 "Color models supported by drivers" in the xcolor for the details.

-
Thanks for the info. I do have xcolor manual open right now and I see, but what I was following off of the article I provided in the question, it seems that it does not work when needing it to produce in pdf format. Using the following I mean: \usepackage[usenames]{color}... \textcolor{BrickRed}{this is a cool red} gives so many errors. I wanted to know how can the already predefined colors from the list of 68 can be used to work for LATEX-->PDF? Which models would I use to make this happen? Without customizing my own colors. –  night owl Aug 12 '11 at 14:52
1. Don't use color but xcolor! 2. What do you exactly mean with LATEX-->PDF? Are you using pdflatex or not? –  Martin Scharrer Aug 12 '11 at 14:54
@ Martin: I don't know exactly all those little details about the pdflatex, dvips. But I use TeXnicCenter and it has LATEX --> PDF in the drop down window. –  night owl Aug 12 '11 at 15:01

You should have a look at the manual of the xcolor package at "2.4 Predefined colors". For all colors - there will be millions of them and I doubt that there is a list of them. When {rgb 0 0.91 0.04001}{rgb}{0,0.91,0.04001} is a colour, also {rgb 0 0.91 0.04002}{rgb}{0,0.91,0.04002} is a colour, and therefore there are a lot of colours.

-

the predefined names are all listed in definition files. You can get a list (on Linux) with

less kpsewhich dvipsnam.def
less kpsewhich svgnam.def
less kpsewhich x11nam.def


or look into the directory of the xcolor package. There you'll find the last two files and the dvipsnam.def is saved in the directory .../tex/latex/graphics/

-

To download "Chroma: a reference book of LaTeX colors" click on Chroma. It's an extensive listing of colors under the various color parameters (rgb, cmyk, ...), and it gives the names defined by xcolor as well as dvips.

Since BrickRed isn't defined in your environment, go to the Chroma reference, find the description of Brick red in terms of a color parameter, and define it:

\documentclass[a4paper]{article}
\usepackage[usenames]{xcolor}
\begin{document}
\definecolor{BrickRed}{rgb}{.72,0,0}
\begin{center} \underline{\textcolor{BrickRed}{Fourier Sine Series}}

\end{center}

\end{document}

-
the color is already defined. –  Herbert Aug 12 '11 at 16:14
@DJP: Thanks alot for your advice. It is still helpful even though I was just looking for the already defined color command. I really appreciated the Chroma manual you dropped off. I was gonna give you the preferred answer, but last minute Caramdir heard all the ruckus and came running with the solution. LoL. Thank though. So for the color charts, you pretty much just look at the color closest to what you are trying to get and copy down the values into a \definecolor{...}{...}{...}? –  night owl Aug 12 '11 at 16:41
Yes, the color chart lets you look for colors you like, find the parameters to generate the color, and then you can define a color as you described. It is poor form to define "BrickRed" like I did since, as Herbert says, it's defined (in dvips). Better to define a new name, like "MyBrickRed", to avoid possible confusion. –  DJP Aug 12 '11 at 16:55
Okay great, will do. –  night owl Aug 12 '11 at 16:58