Spectral evolution of pulse structures in gamma-ray bursts