 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Tim H Guest
|
Posted: Mon Jul 03, 2006 3:09 am Post subject: reverse of rgb |
|
|
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
|
Posted: Mon Jul 03, 2006 3:09 am Post subject: Re: reverse of rgb |
|
|
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
|
Posted: Mon Jul 03, 2006 3:09 am Post subject: Re: reverse of rgb |
|
|
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 |
|
 |
|
|
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
|
|