  Dyson famously provided combinatorial explanations for Ramanujan's partition
congruences modulo $5$ and $7$ via his rank function, and postulated that an
invariant explaining all of Ramanujan's congruences modulo $5$, $7$, and $11$
should exist. Garvan and Andrews-Garvan later discovered such an invariant
called the crank, fulfilling Dyson's goal. Many further examples of congruences
of partition functions are known in the literature. In this paper, we provide a
framework for discovering and proving the existence of such invariants for
families of congruences and partition functions. As a first example, we find a
family of crank functions that simultaneously explains most known congruences
for colored partition functions. The key insight is to utilize a powerful
recent theory of theta blocks due to Gritsenko, Skoruppa, and Zagier. The
method used here should be useful in the study of other combinatorial
functions.
