HSV_HfromRGB example for Delphi
{Takes an RGB, displays the RGB components, and displays the HSV components}
Procedure TForm1.RGBtoHSV(cr : TColorRef) ;
var
red: Integer;
green: Integer;
blue: Integer;
h: Integer;
s: Integer;
v: Integer;
begin
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) + ')');
end;