We show that the topological central charge of a topological phase can be directly accessed from the ground-state wavefunctions for a system on a surface as a Berry curvature produced by adiabatic variation of the metric on the surface, at least up to addition of another topological invariant that arises in some cases. For trial wavefunctions that are given by conformal blocks (chiral correlation functions) in a conformal field theory (CFT), we carry out this calculation analytically, using the hypothesis of generalized screening. The topological central charge is found to be that of the underlying CFT used in the construction, as expected. The calculation makes use of the gravitational anomaly in the chiral CFT. It is also shown that the Hall conductivity can be obtained in an analogous way from the U($1$) gauge anomaly.