Board index » delphi » TColor ..... RGB

TColor ..... RGB

Hi !!!

A simple Question:

I have a string containig the RGB-Values of a color.
I want a panel to change its color to this value:

for example:

MyPanel.Color:= UnknownFunction('ffffff');  this should make the panel white
(clWhite);

The other way is documentated in the help-files:
ColorToRGB--->IntToHex---->String;
but this way is missing.

Anybody knows how to konvert a string to an TColor-Type ??????
Please answer to:
SCHMI...@magnet.at

 

Re:TColor ..... RGB


On 24 Jun 1996 12:24:22 GMT, schmi...@magnet.at (Thomas M. Schmickl)
wrote:

Quote
>I have a string containig the RGB-Values of a color.
>I want a panel to change its color to this value:

>for example:

>MyPanel.Color:= UnknownFunction('ffffff');  this should make the panel white
>(clWhite);

Use StringToColor. This function converts a string to a TColor. If the
string is a color name, then it uses that color. Otherwise, it
converts the string to an RGB value. To force a number to be
interpreted as hexadecimal, prepend a dollar sign.

--
Ray Lischner                              li...@tempest-sw.com
Tempest Software, Corvallis, Oregon, USA  http://www.tempest-sw.com

Other Threads