As Porphyrin already stated in his answer, diamagnetism/paramagnetism has nothing to do with the colour of the compound.
Are d-d transitions possible in diamagnetic complexes?
It depends on the energy of the photon used. If it has sufficient energy then excitation could be possible whether the electrons are paired or not. If the wavelength of the absorbed photon lies in the visible light region then the compound could exhibit colour. So this answers why those two compounds are coloured.
It is given that $\ce{[Co(NH3)6]Cl3}$ has a yellow colour and that $\ce{[Co(NH3)5Cl]Cl2}$ has a purple colour in my textbook. Can the cause of this variation be explained using CFT?
$\ce{NH3}$ is a stronger ligand than $\ce{Cl-}$. So, $\ce{NH3}$ would produce more splitting energy,$\Delta$ (the energy difference between $\ce{t_{2g}}$ and $\ce{e_g}$ set of orbitals) than $\ce{Cl-}$. Therefore, the splitting is maximum in case of $\ce{[Co(NH3)6]^{3+}}$ (since it has a greater number of $\ce{NH3}$ ligands when compared to $\ce{[Co(NH3)5Cl]^{2+}}$).
So more energetic photon is required to excite an electron in $\ce{[Co(NH3)6]Cl3}$ as compared to $\ce{[Co(NH3)5Cl]Cl2}$. But according to the colour wheel, if the observed colour is yellow then absorbed colour could be violet similarly if observed colour is red-violet (purple) then absorbed colour could be yellow-green. So $\ce{[Co(NH3)6]Cl3}$ would absorb violet photon which is more energetic than yellow-green photon. So the splitting energy is more in the case of $\ce{[Co(NH3)6]Cl3}$, which is in agreement with our theory.