split hsvToRGB out into seperate methods

Splitted the conversion of hsvToRGB into seperate methods,
which performs about twice as fast on Firefox.

The main benefit is that it no longer creates the intermediate
array, when this is called.