The star formation history of the Hubble sequence: spatially resolved colour distributions of intermediate-redshift galaxies in the Hubble Deep Field