[Tex/LaTex] RGB color is incorrect

color

I use xcolor to paint some cells of my table. My input code is \cellcolor[RGB]{129,212,83}. And the output is shown as the attached figure. Then I use a color picker software and find the color is actually RGB={148,209,101}. Just wondering anyone know why there is inconsistency?
I am using TexShop with MacTex 2017.

\documentclass[a4paper,11pt]{article}
\usepackage[table]{xcolor}
\begin{document}
\begin{table}[htbp]
  \centering
  \begin{tabular}{@{} c@{}} % Column formatting, @{} suppresses
   {\cellcolor[RGB]{129,212,83}} \\
  \end{tabular}
\end{table}
\end{document} 

enter image description here

Best Answer

This is actually a graphics art question, not a TeX question. TeX is doing the right thing here.

I know more about color than I do about TeX (that's not saying much). My own computer is color-calibrated, so I tried the above code with color management turned on and off. This is partly a matter of the specific computer, and partly a matter of the software used to view the image.

The compiled document shows the expected color (129,212,83) when used with the Gpick application on Ubuntu, directly viewing the PDF. Same result whether TeX native PDF viewer, Ubuntu native PDF viewer, or Acrobat Reader DC.

If I import the PDF as raster to GIMP, and do NOT use color management, then the color remains the expected (129,212,83). But if I DO use color management in GIMP, the color changes to (91,233,86). The amount of change is specific to my computer; your results would be different.

What this means: RGB=(129,212,83) are merely three numbers fed to the monitor. They do not mean any specific color, believe it or not. But sRGB is color standard, in which the number do have a specific color meaning. So, sRGB=(129,212,83) is a specific color with scientific meaning.

When the graphics application does no color management (many do not, especially PDF readers), the screen is fed the raw RGB value, and produces whichever color is calculated by its internal graphics. But when color managed, the software reads color conversions from a table. It knows that the raw data (129,212,83) does not display the standard sRGB=(129,212,83) on my specific monitor. In order to see sRGB=(129,212,83), the numbers fed to the graphics are automatically changed to (91,233,86).

So, if I pick the color displayed by a color-managed application, the picker detects the managed (91,233,86) rather than the raw (129,212,83). The value stored in the PDF is still (129,212,83). I can see it on my monitor by turning off color management; but then the visible shade of green is not technically the correct sRGB color.

It is possible that your color picker has built-in color management. Some software does. Perhaps it can be turned off. Or, the color management may be done by the platform (I do not have your platform to check that).

Related Question