Using transparency
When you draw anything new that overlaps with previously drawn objects, it simply paints over it so that you cannot see what’s behind it anymore. The PDF standard supports partially transparent colors that allow seeing what’s behind them.
TikZ provides a simple interface: you can decide how transparent or opaque the colors of an object or path will be by specifying an opacity
value between 0 and 1. Here, 0 means utterly opaque without transparency, and 1 means entirely transparent, like invisible.
A code is worth a thousand words, so let’s have an example. We will draw water, which is naturally transparent. And we’ll draw a duck, which is naturally in the water.
To have some waves in the water, we load the decorations.pathmorphing
library that we used in the previous chapter:
\usetikzlibrary{decorations.pathmorphing}
TikZ has libraries and packages for everything useful and much silly stuff, so of course, there’s...