Added NaN check in hsp2rgb.