Vcl.Graphics.StringToColor

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function StringToColor(const S: string): TColor;

C++

extern DELPHI_PACKAGE System::Uitypes::TColor __fastcall StringToColor(const System::UnicodeString S);

Properties

Type Visibility Source Unit Parent
function public
Vcl.Graphics.pas
Vcl.Graphics.hpp
Vcl.Graphics Vcl.Graphics

Description

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

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 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.

See Also