...convert RGB values to TColor and vice versa?
Author: Simon Grossenbacher
{
RGB values to TColor
RGB Werte zu TColor
}
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Color := RGB(58, 110, 165);
end;
{
TColor to RGB values
TColor zu RGB Werte
}
procedure TForm1.Button2Click(Sender: TObject);
var
Color: Longint;
r, g, b: Byte;
begin
Color := ColorToRGB(Edit1.Color);
r := Color;
g := Color shr 8;
b := Color shr 16;
label1.Caption := ' Red : ' + IntToStr(r) +
' Green: ' + IntToStr(g) +
' Blue : ' + IntToStr(b);
end;
printed from
www.swissdelphicenter.ch
developers knowledge base