The Ramsey theorem says that for any countably infinite undirected clique whose edges are colored by a finite number of colors, there is an infinite subclique whose edges are colored by a single color. In this note, we generalize the theorem to a situation where the colors form a compact metric space.