# TeXcolorrgb vs. setrgbcolor

I wonder if there is a tiny difference of the produced color within the resulting pdf.

Within this given example - two colored lines differently setup.

One line is setup with LaTeX, the other line is setup with PSTricks:

\documentclass{article}
\usepackage{pstricks}
\begin{document}
\textcolor{red!30}{\rule{4cm}{5mm}}

\begin{pspicture}(0,0)(4,1)
\psline[linecolor=red!30,linewidth=0.5cm](0,0)(4,0)
\end{pspicture}
\end{document}


Compiling it via dvips and then regarding the resulting *.ps file, I get the following lines within the *.ps file:

For the LaTeX generated line, I see: 1 0.7 0.7 TeXcolorrgb

For the PSTricks generated line, I see: 1 0.7 0.7 setrgbcolor

Will both produce the exact same colors within the resulting PDF and how can I proof the color within the final PDF?

Any hints welcome.

Kind regards,

Jürgen

setrgbcolor is the PostScript primitive to set an RGB colour. TeXcolorrgb is the name dvips inserts into the PostScript stream if you use a color \special with model rgb, this indirection allows for user specified models, but in the case of rgb the header file color.pro just defines TeXcolorrgb to be setrgbcolor

/TeXcolorrgb { setrgbcolor } def


so the two forms are the same thing.

• ... any hint still for how to proof that within the final PDF? – user151328 Jun 11 '18 at 19:10
• you can set \pdfcompresslevel=0 then just look for the equivalent pdf 1 .07 0.7 rg @JürgenG – David Carlisle Jun 11 '18 at 19:44