Optical Properties from Density-Functional Theory