HSV converting in existing code