In CuSO4.5H2O,water acts as ligand as a result it causes crystal field splitting.
Hence d-d transition is possible in field splitting is CuSO4.5H2O and shows color.
In the anhydrous CuSO4 due to the absence of water (ligand), crystal not possible and hence no color.