Hi, I am trying to add some color to my tables but it has been a very frustrating experience since I am a novice.
I have been using the xcolor package to do this, with the \rowcolor command. The command works perfecty when i use "gray", however as soon as i try any other color(even if I specifically define it) it gives me the error:
Package xcolor Error: Undefined color model 'red'
Any ideas would be useful.
thanks,
Chris
Here is my code...
...
\usepackage{color}
\usepackage{xcolor}
\usepackage[table]{xcolor}
\definecolor{red}{RGB}{255,0,0}
...
\begin{center}
\begin{tabular}{|l|c|c|}
\hline
\multicolumn{3}{|c|}{\bf{Paddle Pinout}} \\
\hline
\rowcolor[red]{.9} Pin \#&(Left Paddle)&(Right Paddle)\\
\hline
1, N.A. & & \\ \hline
2, Red (Power) & 50 & 50\\ \hline
\end{tabular}
\end{center}
Graphics, Figures & Tables ⇒ Package xcolor Error:Undefined color model 'red'
NEW: TikZ book now 40% off at Amazon.com for a short time.

Package xcolor Error:Undefined color model 'red'
There happens to be a color model named "gray", and not just a color. There is no color model named "red". There is of course a color named "red", but there is no need to define it. It's built in.
I think it would behoove you to read the xcolor package documentation so you understand the difference between color models and colors.
Also, there is no need to load the color package if you're loading xcolor, and xcolor should only be loaded once.
Also, please pay attention to the Board Rules, and the post on Post on Avoidable Mistakes, especially with regard to putting code in code boxes and always providing complete compiliable minimal working examples.
I suspect what you want is probably something like this:
Or perhaps {red!90!black} instead, depending on whether you want it 90% red and 10% white (or 90% red and 10% black). They gray color model just gives just the spectrum from white to black, I wouldn't know how to apply that kind of thinking to red.
I think it would behoove you to read the xcolor package documentation so you understand the difference between color models and colors.
Also, there is no need to load the color package if you're loading xcolor, and xcolor should only be loaded once.
Also, please pay attention to the Board Rules, and the post on Post on Avoidable Mistakes, especially with regard to putting code in code boxes and always providing complete compiliable minimal working examples.
I suspect what you want is probably something like this:
Code: Select all
\documentclass{article}
\usepackage[table]{xcolor}
\begin{document}
\begin{center}
\begin{tabular}{|l|c|c|}
\hline
\multicolumn{3}{|c|}{\bf{Paddle Pinout}} \\
\hline
\rowcolor{red!90!white} Pin \#&(Left Paddle)&(Right Paddle)\\
\hline
1, N.A. & & \\ \hline
2, Red (Power) & 50 & 50\\ \hline
\end{tabular}
\end{center}
\end{document}
Re: Package xcolor Error:Undefined color model 'red'
Great! thank you. I did not think of gray as a color model. I will follow the standards of the forum next time I have a question.
Thanks again,
Chris
Thanks again,
Chris
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Package xcolor Error:Undefined color model 'red'
Now that the problem is solved, please be so kind and mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.
Best regards and welcome to the board
Thorsten
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10