Board index » delphi » Changing TColor into Respective RGB values

Changing TColor into Respective RGB values

How would one convert a TColor into 3 seperate RGB values (0-255)?
 

Re:Changing TColor into Respective RGB values


You can use the GetRValue, GetGValue and GetBValue API Calls.

Ryan
"Black Hole Wanderer" <kpadmi...@hotmail.com> wrote in message
news:8rgb2m$cis4@bornews.borland.com...

Quote
> How would one convert a TColor into 3 seperate RGB values (0-255)?

Re:Changing TColor into Respective RGB values


"Black Hole Wanderer" <kpadmi...@hotmail.com> wrote in message
news:8rgb2m$cis4@bornews.borland.com...

Quote
>> How would one convert a TColor into 3 seperate RGB values (0-255)?

>You can use the GetRValue, GetGValue and GetBValue API Calls.

>Ryan

I think you have to use the ColorToRGB(..) function first before getting the
R, G and B values...

--
Paul Nicholls (Delphi 5)     Live long and optimise!
"Quidquid latine dictum sit, altum videtur" (Whatever is said in Latin
sounds profound) Author unknown

 Home Page: www.southcom.com.au/~phantom
       < IF YOU WANT TO EARN MONEY WHILE YOU SURF ON THE NET GO HERE: >
       < http://www.alladvantage.com/go.asp?refid=BEM-274 >

Re:Changing TColor into Respective RGB values


Quote
Paul Nicholls <phan...@southcom.com.au> wrote in message 39dbb6f5_1@dnews...
> "Black Hole Wanderer" <kpadmi...@hotmail.com> wrote in message
> news:8rgb2m$cis4@bornews.borland.com...
> >> How would one convert a TColor into 3 seperate RGB values (0-255)?

> >You can use the GetRValue, GetGValue and GetBValue API Calls.

> >Ryan

> I think you have to use the ColorToRGB(..) function first before getting
the
> R, G and B values...

sorry but i think this is not true :

procedure getrgb(color:tcolor;var r,g,b:byte);
begin
r:=getrvalue(color);
g:=getgvalue(color);
b:=getbvalue(color);
end;

Other Threads