0

If I want to use predefined colors to color rows with the colortbl package, it doesn't work:

\documentclass{article}

\usepackage{xcolor}
\usepackage{color}
\usepackage{array}
\usepackage{colortbl}

\definecolor{anti-flashwhite}{rgb}{0.95, 0.95, 0.96}

\begin{document}

\begin{tabular}{c|c}
     \rowcolor[anti-flashwhite]{0.5}Eins & Zwei  \\
     \rowcolor[gray]{0.5}Drei & Vier
\end{tabular}
\end{document}

Any ideas how to make it work?

  • \rowcolor{anti-flashwhite}{0.5} the optional argument would correspond to a color model such as rgb, cmyk or gray. Hence the error message Package xcolor Error: Undefined color model anti-flashwhite. that you will get from your code. – leandriis Apr 09 '20 at 17:11
  • 1
    Instead of xcolor, color and colortbl you only need \usepackage[table]{xcolor}. – leandriis Apr 09 '20 at 17:13
  • @leandriis \usepackage[table]{xcolor} still doesn't work for me. Same error message Package xcolor Error: Undefined color model anti-flashwhite. – LinusDieLinse Apr 09 '20 at 17:42
  • anti-flashwhite must be placed in a set of {} instead of [] when used with the \rowcolor command. The remark about the packages was more a side note than actually related to the error message itself. – leandriis Apr 09 '20 at 17:49
  • https://tex.stackexchange.com/questions/112671/define-and-use-new-colors-for-rowcolor-colortbl?rq=1 – js bibra Apr 10 '20 at 00:10

0 Answers0