Hi, use the following functions:

type
    TRGB = record
        R: Integer;
        G: Integer;
        B: Integer;
end;

function RGBToColor(PR,PG,PB: Integer): TColor;
begin
    Result := TColor((PB * 65536) + (PG * 256) + PR);
end;

function ColorToRGB(PColor: TColor): TRGB;
var
    i: Integer;
begin
    i := PColor;
    Result.R := 0;
    Result.G := 0;
    Result.B := 0;
    while i - 65536 >= 0 do begin i := i -
                             65536; Result.B := Result.B + 1; end;
    while i - 256 >= 0 do begin i := i -
                             256; Result.G := Result.G + 1; end;
    Result.R := i;
end;

function RGBToCol(PRGB: TRGB): TColor;
begin
    Result := RGBToColor(PRGB.R,PRGB.G,PRGB.B);
end;

Now, you can write;
var RGB:TRGB ;

begin
RGB:=ColorToRGB(clBtnFace);

Hope that help.

Monir.

----- Original Message -----
From: "Liz Hundy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 13, 2005 12:05 PM
Subject: system colours


> Please can someone tell me how I get the RGB colour numbers from
clBtnFace.
> GetBValue, getRValue, getGValue  give silly numbers (Delphi 5 and XP).
> ---Liz
>
>
>
> __________________________________________________
> Delphi-Talk mailing list -> [EMAIL PROTECTED]
> http://www.elists.org/mailman/listinfo/delphi-talk


__________________________________________________
Delphi-Talk mailing list -> [EMAIL PROTECTED]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to