We introduce notions of local and interweight spectra of an arbitrary coloring of a Boolean cube, which generalize the notion of a weight spectrum. The main objects of our research are colorings that are called perfect. We establish an interrelation of local spectra of such a coloring in two orthogonal faces of a Boolean cube and study properties of the interweight spectrum. Based on this, we prove a new metric property of perfect colorings, namely, their strong distance invariance. As a consequence, we obtain an analogous property of an arbitrary completely regular code, which, together with his neighborhoods, forms a perfect coloring.