HSV_HfromRGB example for C++Builder
/*Takes an RGB, displays the RGB components, and displays the HSV components*/
void TForm1::RGBtoHSV(TColorRef cr)
{
int red;
int green;
int blue;
int h;
int s;
int v;
red= GetRValue (cr);
green= GetGValue (cr);
blue= GetBValue(cr);
h= LEADImage1->HSV_HfromRGB(cr);
s= LEADImage1->HSV_SfromRGB(cr);
v= LEADImage1->HSV_VfromRGB(cr);
ShowMessage ( "RGB (" + IntToStr(red) + "," + IntToStr(green) + "," + IntToStr(blue) + ") is HSV(" + IntToStr(h) + "," + IntToStr(s) + "," + IntToStr(v) + ")");
}