ImageEn, unit hyieutils

ColorToHSV


Declaration

procedure ColorToHSV(cl: TColor; var h, s, v: Integer);


Description

Converts a TColor to HSV values.

H (Hue) is from 0 to 359 (corresponding to 0..359 degrees around a hexcone).
S (Saturation) is from 0 (shade of gray) to 99 (pure color).
V (Value) is from 0 (black) to 99 (white).


Example

// Colorize the image based on the user's selection of a color
if IEPromptForColor( cl ) then
begin
  ColorToHSV( cl, h, s, v );
  ImageEnView1.Proc.Colorize( h, s, 1.0 );
end;

// User selected Red...