|Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread|
|Messages 1 to 3 of 3 total|
|How to get a TColor from a string|
|Mon, Jun 8 2020 7:19 PM||Permanent Link|
I have a list of colors such as :
"clOrange = $FFFFA500"
Each color is an item in a string list.
How can I use either the clOrange part or the $FFFFA500 part to get a TColor value that I can use in my app?
|Tue, Jun 9 2020 4:23 AM||Permanent Link|
Paul Coshott wrote:
> the $FFFFA500
It may be you have to rearrange the order of the RGB bytes after that.
|Tue, Jun 9 2020 9:30 AM||Permanent Link|
"Matthew Jones" wrote:
>> replace the $ with 0x and it should work for you.
Worked perfectly. I didn't need to play with the RGB bytes. For anyone interested:
myColor : TColor;
myStrCol : string;
myStrCol := '0xFFFFA500';
myColor := TColor(StrToInt(myStrCol));
This web page was last updated on
Wednesday, March 29, 2023 at 12:35 AM
© 2023 Elevate Software, Inc. All Rights Reserved
Questions or comments ? E-mail us at firstname.lastname@example.org