3

I want to have a fill color with transparency but I also want the text to be perfectly opaque. But somehow it does not work.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,}

\begin{document}

\begin{tikzpicture}[myStack/.style={
  rectangle split, 
  rectangle split parts=3, 
  draw, 
  fill=yellow,
  fill opacity = 0.6,
  text=black,
  text opacity = 1,
  }]

\node [myStack]{
                abc
\nodepart{two}  bde
\nodepart{three}cfg
};
\end{tikzpicture}

\end{document}

enter image description here

When I zoom in (Adobe Reader) then I also see that even the black border is not really black and rather dark gray.

Can somebody reproduce the problem?

Update

After I updated MiKTeX the problem was kind of solved. However black still is rather dark gray. After opening the PDF with Adobe Professional I figured out that when I change the color profile then black is black again. See the screenshots (in German):

Problem: Black is gray

enter image description here

enter image description here

enter image description here

enter image description here

Problem solved:

enter image description here

Can anyone reproduce that black is not black?

PS: I think it's related to this question.

Problem Solved

Apparently this and this questions address the same problem. Adding

\pdfpageattr{/Group <</S /Transparency /I true /CS /DeviceRGB>>}

before \begin{document} solved the problem. According to Martin Heller "this makes Adobe Reader use the RGB rendering model for pages with transparency". Still I don't get it fully...

  • Your mwe perfectly work to me. Fill is yellow with given transparency and do not interfere with text opacity, i.e. text is black. I check in Sumatra as well in Adobe Reader. Regarding your definition of "myStack" the line "fill=yellow" is superfluous, it is sufficient to declary just "fill opacity=0.6". – Zarko Apr 5 '14 at 18:11
  • Hi. But I have to declare a color. How could this be superfluous? – Dr. Manuel Kuehner Apr 5 '14 at 22:53
  • You have right. I mismatch text color width fill color. If you like to have black text, it is not necessary to define text color. Sorry for my mismatch. – Zarko Apr 6 '14 at 2:28
  • @dr In A(R)-DC this doesn't seem an issue anymore. – AlexG Mar 12 '18 at 8:18
1

Fillopacity will affect the text, if you want a "transparent" color, and a black text do yellow!60 instead.

enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,}

\begin{document}

\begin{tikzpicture}[myStack/.style={
  rectangle split, 
  rectangle split parts=3, 
  draw, 
  fill=yellow!60,
  %fill opacity = 0.6,
  }]

\node [myStack]{
                abc
\nodepart{two}  bde
\nodepart{three}cfg
};
\end{tikzpicture}

\end{document}
  • What does the ! mean? – Dr. Manuel Kuehner Apr 5 '14 at 17:52
  • Try yellow!10, yellow!50, yellow!10!red, it is a melting between first and second color : 10% red 90% yellow. See xcolor manual – Tarass Apr 5 '14 at 18:22
  • 2
    But this doesn't really explain why the OP is getting the strange output he describes in his question. The original code should work as expected (in fact, it does on my system), so perhaps is just a matter of updating packages? – Gonzalo Medina Apr 5 '14 at 18:31
  • @GonzaloMedina: on my system line are black and the three texts are gray. If put only fill opacity=0.6, with no fill color the text is gray too. I have installed pfg 3.0. Witch packages should be updated ? – Tarass Apr 5 '14 at 19:06
  • In my real usage I have a background and therefore I need real transparency. I will try to update tomorrow. Thanks so far. – Dr. Manuel Kuehner Apr 5 '14 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.