Fixed the inaccuracy bug when converting

Changed the hsl conversion function to be more accurate.

Values are now also stored globally, so that the stored values can be
used (this improves speed and accuracy of the values).