RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Graphics.StringToColor Function

Translates a string representation of a color to the corresponding TColor value.

Pascal
function StringToColor(const S: string): TColor;
C++
TColor StringToColor(const AnsiString S);

Call StringToColor to reverse the translation performed by ColorToString. This method is useful for converting the strings entered by the user into useable TColor values. 

The S parameter can be either the name of a built-in color constant, such as "clBtnFace" (Windows) or "clBtnText" (cross-platform), or the string representation of a valid TColor value such as "$02FF8800" (Delphi) or "0x02FF8800" (C++). StringToColor returns the TColor value that corresponds to the S parameter.

Note: If the string identifier can only be the name of a color constant, use IdentToColor instead.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!