# Alpha channel in colortbl

I'm using the colortbl package to color table cells. I've combined this w/ the xcolor package to define my own colors. However, it appears that xcolor does not support transparency. I saw the package transparent, but it is oriented toward text and I wasn't able to set the transparency level of a defined color. Are there any packages that support alpha color channels?

-

## migrated from stackoverflow.comMay 18 '12 at 18:39

This question came from our site for professional and enthusiast programmers.

You could do that either with PSTricks or with PGF/TikZ. A similar problem was discussed here: latex-community.org/forum/viewtopic.php?f=5&t=697 –  Mica Oct 28 '09 at 23:48
Yes, I saw that page, it doesn't really seem to address my question. Does anyone know how I could use TikZ to do this? I'd like to stick w/ pdflatex. –  Peter Oct 29 '09 at 3:46
Thanks, I saw that one as well, but he does not actually color cells in that table using TikZ as far as I can see. He uses colortbl which to the best of my knowledge doesn't accept colors w/ alpha channels –  Peter Oct 29 '09 at 18:12
colortbl doesn't really care (much) what the color command is it just arranges to put a normal TeX rule behind the table cell and inser a "colour command" at suitable points to affect the color. so basically if tikz or pstricks or anything allows you to define a transparent colour such that (say) \color{something}\hrule makes a rule of transparent colour something then the same shoud work in colortbl. –  David Carlisle May 18 '12 at 18:58

The following shows colortbl transparent panels allowing the coloured box behind the table to show through.

\documentclass{article}

\usepackage{transparent,colortbl}

\makeatletter
\def\CT@@do@color{%
\global\let\CT@do@color\relax
\@tempdima\wd\z@
\kern-\@tempdimb
\transparent{0.6}%
\hskip\@tempdima\@plus  1fill
\kern-\@tempdimc
\hskip-\wd\z@ \@plus -1fill }
\makeatother

\begin{document}

\noindent\colorbox[rgb]{1,.5,.5}{\Large\strut \hspace{2in}}\hspace{-.5in}
\begin{tabular}{lll}
\rowcolor{blue} a & b & c\\
aa&bb&cc\\
\rowcolor{yellow}1&2&3\\
11&22&33
\end{tabular}
\end{document}

-
this workaround doesn't work with tabularx –  user24679 Jan 21 '13 at 14:06