  Let $\mathbf{G}:=(G_1, G_2, G_3)$ be a triple of graphs on the same vertex
set $V$ of size $n$. A rainbow triangle in $\mathbf{G}$ is a triple of edges
$(e_1, e_2, e_3)$ with $e_i\in G_i$ for each $i$ and $\{e_1, e_2, e_3\}$
forming a triangle in $V$. The triples $\mathbf{G}$ not containing rainbow
triangles, also known as Gallai colouring templates, are a widely studied class
of objects in extremal combinatorics.
  In the present work, we fully determine the set of edge densities $(\alpha_1,
\alpha_2, \alpha_3)$ such that if $\vert E(G_i)\vert> \alpha_i n^2$ for each
$i$ and $n$ is sufficiently large, then $\mathbf{G}$ must contain a rainbow
triangle. This resolves a problem raised by Aharoni, DeVos, de la Maza,
Montejanos and \v{S}\'amal, generalises several previous results on extremal
Gallai colouring templates, and proves a recent conjecture of Frankl, Gy\"ori,
He, Lv, Salia, Tompkins, Varga and Zhu.
