Reduce complexity of rgb_to_hsv