Fixed errors in javascript; wrote spectral class to color function