Problem outline
Let's suppose we have charts placed in a common coordinate system in such a way that the colored areas of these charts overlap.
We want to ensure that all the plots and their overlapping areas are clearly visible — they must not obscure or merge into one another. Mathematica allows you to make overlapping colored areas visible by setting partial transparency (using Opacity[o] with $o<1$) for individual colors. I think this method of combining colors is called $\alpha$-mixing.
However, this solution is unsatisfactory because transparency causes the background to show through. (If the background is set to be transparent, the final image will contain semitransparent color fields, and if the background is white, the colors will appear washed out.)
Instead, I would prefer the colors to be fully opaque, and in places where the colored areas overlap, for them to be mixed according to some recipe other than $\alpha$-mixing — for example, additive color mixing in the RGB model. How can this be achieved?
Elaboration
The specific form of the chart, let alone the functions it delineates, are irrelevant here. In Mathematica's 2D graphics, whenever fields of different colours are superimposed, either simply the top one is visible or $\alpha$-mixing is employed. So let's prepare some example functions and their plot that demonstrate this issue clearly.
Preparation of sample functions and their overlapping plots
funs = {Sin[1/(x/3)^2] + x, -Sin[1/(x/3)^2] - x, 2 Sin[1/((2 x)^3)]}; Plot[funs, {x, -Pi/2, Pi/2}, PlotPoints -> 2^8, ImageSize -> Large]
(The functions and their parameters were chosen so that the colour fields of their plots are clearly overlapping).
(I do not insist that the example shown is the best possible. Perhaps the need to make areas of overlap visible is even better seen from the first illustration (obtained from real data).)
Unsatisfactory solution
An obvious way to show areas of colour field overlap is the use of transparency.
Plot[funs, {x, -Pi/2, Pi/2}, PlotStyle -> Opacity[0.5], PlotPoints -> 2^8, ImageSize -> Large]
This solution has the following drawbacks:
- Transparency is applied to entire plots, not just their overlapping parts. Therefore, the background shows through from underneath (directly, when opaque, or by a value $<1$ on the $\alpha$-channel, when transparent).
- The areas of overlap are not sufficiently distinct.
- The order in which the plots are overlaid matters.
Aim
I am looking for a systematic way to blend layer colours only where the colour fields overlap, while leaving the plot colours completely opaque. As a first attempt, I would like to try additive colour mixing in the RGB model. Ultimately, a solution is sought that allows any colour blending recipe to be given as a function.






