Mega Code Archive

 
Categories / Delphi / Examples
 

Colorstr

> ReadString returns clWindowText as a string, but Color expects a TColor type, > which is numeric. You could either save the value of clWindowText in the Ini > file, with WriteInteger, or use a lookup table of the various color string > options. Just to let everyone know, the GraphicsUnit has two useful functions: StringToColor and ColorToString. StringToColor will receive one of the valid 37 colors (such as clWhite) or a number (as a string) representing the color and return a TColor for it. ColorToString will do the reverse.