Graphics, Figures & Tablescolortbl, xcolor | Unrecognized Color Model

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

colortbl, xcolor | Unrecognized Color Model

Post by Bozack »

I seem to have problems with using dvipsnames color names when working with the colortbl package, as the following example should show:

Code: Select all

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

\begin{document}

blah blah {\color{Red} blah} blah

\begin{tabular}{l l l l}
  head 1& head 2& head 3& head 4\\
  \rowcolor[Red]{.85} 
  fill A& fill B& fill C& fill D\\
  fill A& fill B& fill C& fill D\\
  fill A& fill B& fill C& fill D
\end{tabular}

\end{document}
The "blah" in the top correctly gets a red color, but I get an

Code: Select all

Package xcolor Error: Undefined color model `Red'.
for the line with the \rowcolor command - even though the color is clearly understood.

Has anyone found this problem before, and know how to fix it so I can use the dvipsnames color names in my table colors?
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

colortbl, xcolor | Unrecognized Color Model

Post by cgnieder »

The syntax for the command \rowcolor is

Code: Select all

\rowcolor{color name} % or
\rowcolor[color model]{color specs}
Since there is no color model »Red« you get this error. Read the xcolor manual for detailed information about colors, color names, color models and color specifications.

In the case at hand you probably want

Code: Select all

\rowcolor{red!85}
Regards
site moderator & package author
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

colortbl, xcolor | Unrecognized Color Model

Post by Bozack »

cgnieder wrote:The syntax for the command \rowcolor is

Code: Select all

\rowcolor{color name} % or
\rowcolor[color model]{color specs}
In the case at hand you probably want

Code: Select all

\rowcolor{red!85}
Thank you so much for your answer - that was exactly what I was looking for :)
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit
Post Reply