public float SqrDistance(pb_HsvColor InColor) { return (InColor.h/360f - this.h/360f) + (InColor.s - this.s) + (InColor.v - this.v); }
/** * Convert HSV to RGB. * http://www.cs.rit.edu/~ncs/color/t_convert.html * r,g,b values are from 0 to 1 * h = [0,360], s = [0,1], v = [0,1] * if s == 0, then h = -1 (undefined) */ public static Color HSVtoRGB(pb_HsvColor hsv) { return HSVtoRGB(hsv.h, hsv.s, hsv.v); }