Fix HSV calculation