Color myColor = Color.Blue; int argbValue = myColor.ToArgb();
int argbValue = -16776961; // this represents the color red Color myColor = Color.FromArgb(argbValue);
string hexCode = "#00FF00"; // this represents the color green Color myColor = ColorTranslator.FromHtml(hexCode); int argbValue = myColor.ToArgb();These examples show how the ToArgb method can be used in combination with other methods in the System.Drawing namespace to convert colors between different formats. The package library for this namespace is the System.Drawing.dll.