A graph is weakly perfect if its clique number and chromatic number are equal. We show that the enhanced power graph of a finite group G is weakly perfect: its clique number and chromatic number are equal to the maximum order of an element of G. The proof requires a combinatorial lemma. We give some remarks about related graphs.