Let G:=(G1,G2,G3) be a triple of graphs on the same vertex set V of size n. A rainbow triangle in G is a triple of edges (e1,e2,e3) with ei∈Gi for each i and {e1,e2,e3} forming a triangle in V. The triples 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 (α1,α2,α3) such that if ∣E(Gi)∣>αin2 for each i and n is sufficiently large, then G must contain a rainbow triangle. This resolves a problem raised by Aharoni, DeVos, de la Maza, Montejanos and Šámal, generalises several previous results on extremal Gallai colouring templates, and proves a recent conjecture of Frankl, Györi, He, Lv, Salia, Tompkins, Varga and Zhu.