BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

reverse of rgb

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Tim H
Guest





PostPosted: Mon Jul 03, 2006 3:09 am    Post subject: reverse of rgb Reply with quote



 Can someone tell me what the function is (I assume there is one) that
does the opposite of the RGB function. I cant seem to find it. I need to
obtain the red, green and red values from a TColor.
Any Help much appreciated.

Tim



--- posted by geoForum on http://delphi.newswhat.com
Back to top
Jolyon Smith
Guest





PostPosted: Mon Jul 03, 2006 3:09 am    Post subject: Re: reverse of rgb Reply with quote



In article <44a8383e$1 (AT) newsgroups (DOT) borland.com>, xxx (AT) xxx (DOT) co.uk says...
Quote:
 Can someone tell me what the function is (I assume there is one) that
does the opposite of the RGB function. I cant seem to find it. I need to
obtain the red, green and red values from a TColor.
Any Help much appreciated.

See: GetRValue, GetGValue, GetBValue

See also: ColorToRGB() - not all TColor values are directly expressible
as R G B values and need conversion if you want meaningful RGB
information.

e.g. clHighlight isn't a color, it _identifies_ a color.

hth

--
Jolyon Smith
Back to top
Rudy Velthuis [TeamB]
Guest





PostPosted: Mon Jul 03, 2006 3:09 am    Post subject: Re: reverse of rgb Reply with quote



At 00:09:48, 03.07.2006, Tim H wrote:

Quote:
 Can someone tell me what the function is (I assume there is one) that
does the opposite of the RGB function. I cant seem to find it. I need
to obtain the red, green and red values from a TColor.

You can use ColorToRGB and obtain a Longint. This Longint is built up
like a TRGBQuad, so you should be able to cast back and forth.

TColors can either contain real RGB values or they can be symbolic values
for system colors. So you will always have to use ColorToRGB first, so
you have a real RGB value.

You can of course also use GetRValue, GetGValue and GetBValue from
Windows.pas:

Blue := GetBValue(ColorToRGB(YourColor));

To do the reverse, you can use the RGB() function.
--
Rudy Velthuis [TeamB] http://rvelthuis.de/

"Computers make it easier to do a lot of things, but most of the things
they make it easier to do don't need to be done." -- Andy Rooney.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.