i’m want to do RGB to HSL with delphi, my code:
uses
System.UIConsts;
procedure TForm1.Button3Click(Sender: TObject);
var
H, S, L: Single;
begin
var R := 157;
var G := 157;
var B := 152;
var alc := MakeColor(R, G, B, 255);
RGBtoHSL(alc, H, S, L);
//FROM: https://www.rapidtables.com/convert/color/rgb-to-hsl.html
//HSL: 60,2.5,60.6 <--correct Value
ShowMessage(Format('HSL: %.1f,%.1f,%.1f', [H, S * 100, L * 100])); //<---wrong Hue's value
end;
how can i get the correct Hue value?
thanks.
New contributor
Frank.Wu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.