Corrected some mistakes in the HSV color calculation.
Simplyfied calculation of HSV color.