We define vertex-colourings for edge-coloured digraphs, which unify the theory of $P$-partitions and proper vertex-colourings of graphs. We use our vertex-colourings to define generalized chromatic functions, which merge the chromatic symmetric and quasisymmetric functions and generating functions of $P$-partitions.