Colors and taxonomy of Centaurs and trans-Neptunian objects