TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In theory, additive mixing Red color and Green color produces Yellow color.

In my mental model, additive mixing opaque Red and opaque Green will produce opaque Yellow.

But the following attempt, I got a result that is different from my mental model.


alt text

Minimal Code (PSTricks)



Minimal Code (PGF/Tikz)


    \draw [fill=red,opacity=0.5](1,1) circle (1);
    \draw [fill=green,opacity=0.5](2,1) circle (1);
    \draw [fill=yellow,opacity=0.5] (0,2)--(0,3)--(3,3)--(3,2)--cycle;
share|improve this question
Is this a question about TeX or friends? – Seamus Jan 1 '11 at 20:03
I learned this in primary school :P Couldn't remember much of it, though, as it was some 20 years ago, so thanks @Caramdir... – Vivi Jan 1 '11 at 22:41
Your code and question are different. Your code draws two semi-transparent circles; are you asking why their overlap is a brown-yellow color instead of bright yellow? Or are you asking why code such as \fill [red] (0,0) circle (2cm) ; \fill [green] (0,1) circle (2cm) ;, which draws opaque circles, produces no yellowish region at all? – Antal Spector-Zabusky Jan 1 '11 at 22:58
@Antal, the question based on the output produced by the codes. Your question confirmation is my question. – xport Jan 2 '11 at 3:27
up vote 6 down vote accepted

The result you get isn't what you expect because tikz is using an rgb colour model; try the following document to see how the colour model matters. Since tikz doesn't support hsb, your intuitive mixing model doesn't work.


    \draw [fill=red,opacity=0.5](1,1) circle (1);
    \draw [fill=green!50,opacity=0.5](2,1) circle (1);
    \draw [fill=yellow,opacity=0.5] (0,2)--(0,3)--(3,3)--(3,2)--cycle;

Equal parts mixture of red!50 and green!50 (rgb model):

This is equivalent to your overlapping circles.

Equal parts mixture of red!50 and green!50 (hsb model):

This is equivalent to what you expected.

share|improve this answer
thanks for answering. It solved the problem. Using clipping technique, I will fill the overlapped region manually. – xport Jan 2 '11 at 5:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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