Login ProductsSalesSupportDownloadsAbout |
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 |
Paul Coshott | Hi All,
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? Thanks, Paul |
Tue, Jun 9 2020 4:23 AM | Permanent Link |
Matthew Jones | Paul Coshott wrote:
> the $FFFFA500 Looking at my code, the key is the Javascript parseint which is used by StrToInt, which takes 0x as a hex prefix. So replace the $ with 0x and it should work for you. It may be you have to rearrange the order of the RGB bytes after that. -- Matthew Jones |
Tue, Jun 9 2020 9:30 AM | Permanent Link |
Paul Coshott | "Matthew Jones" wrote:
>> replace the $ with 0x and it should work for you. Thanks Matthew, Worked perfectly. I didn't need to play with the RGB bytes. For anyone interested: var myColor : TColor; myStrCol : string; begin myStrCol := '0xFFFFA500'; myColor := TColor(StrToInt(myStrCol)); |
This web page was last updated on Monday, September 9, 2024 at 03:13 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |