convert RGB color to HSL
void RGBtoHSL( DWORD crRBG, double * hue, double * sat, double * light )
EX1
void rgb2hsl_ex1(int rr, int gg, int bb) { double hh, ss, ll; DWORD rgb = RGB(rr, gg, bb); RGBtoHSL(rgb, &hh, &ss, &ll); printf("%d %d %d\n", nint(hh*360),nint(ss*100),nint(ll*100)); }
HSLtoRGB
origin.h