The full four-loop cusp anomalous dimension in $$ \mathcal{N} $$ = 4 super Yang-Mills and QCD